Hi, I'm having trouble making thePlayer keep it's momentum after teleportation... Currently the car resets without damage when teleported and also looses it's momentum. I've read some old post and watched some videos on how to set up a lua trigger and do teleporting, where they mentioned that rotation has to be off, but I have not added any rotation... Currently using this lua script in the trigger: Code: local function teleportPlayer(data) local vehicleName = data.subjectName if data.event == 'enter' and data.subjectName ~= 'scenario_player0' then TorqueScript.eval(vehicleName..'.position = "0 0 0.315";') end end return teleportPlayer Edit: Starting to think this is related: https://www.beamng.com/threads/f7-resets-car.86522/ Old thread, and video: https://www.beamng.com/threads/how-...-with-triggers-scroll-down-for-the-zip.54376/
I think I need to use "setPositionNoPhysicsReset" instead of "position", as there seems to have been an update, and a reset is now the default. However, I'm new to lua, and not sure how to implement it correctly... trying to change it out I get errors...
Have this now, and it seems to be working... Code: local function teleportPlayer(data) if data.event == 'enter' then pos = Point3F(0,0,0.277) cow = scenetree.findObject(data.subjectName) cow:setPositionNoPhysicsReset(pos) end end return teleportPlayer --- Post updated --- What i'm lacking with this is moving the camera too, it does not stay in the same place relative to the car... this is not a big problem when I teleport in the same direction as i'm already moving, but when I teleport behind myself, the camera first shows the front of the car, then spins around to the back... Any tips on how to do that would be greatly appreciated
Hahaha, that is my video... I noticed too that things are not keeping momentum. Thanks for updated LUA for those wanting to keep momentum it seems after some recent update. I do not know LUA, I copied pasted from someone else. I tried to teach myself watching YouTube videos but caught a case of acute narcolepsy lol. Ever have trouble sleeping, watch a how to program LUA tutorial. They are almost as boring as my tutorials