I'm creating a scenario on the East Coast USA map. Needed to remove theForest since the AI keeps crashing into it. I removed it with this code (thanks bidwars!): Code: local function onScenarioLoaded() TorqueScript.eval('if(isObject("theForest")) {"theForest".delete(); }') end The forest does delete, and I can drive around where the trees used to be freely. BUT, every now and then, I or an AI will crash into something invisible! I've tried going into the Editor as soon as I crashed into something and dragging a selection box around to see if there's anything there. Found nothing. There are multiple invisible colliders where this happens. Any ideas?
In the debug menu, there is an option for 'Static Collisions'. If you turn it on, you should see anything collide-able highlighted. IIRC it should be accessible while in scenario mode still.
Your function is just deleting 'theForest' objects. You should also call 'be:reloadCollision()' to recalculate collisions.
Sweet, thanks for the solutions guys! Since I highly doubt I ever would have come across that reloadCollision function, do you have any tips on how to find functions/commands for modding like this? I've looked through the Lua wiki but it doesn't seem to have functions like the one you referenced or TorqueScript commands listed.
Unfortunately there's no complete reference for functions, properties etc. yet. The easiest solution for now is probably to search in stock-lua files for a specific keyowrd e.g. 'collision' Sublime Text has a quite nice and relatively fast function by pressing Ctrl+Shift+F.