I'm experimenting with some cannibalized code from this thread. Everything seems to be working as I'd like and a prop is teleporting at the front end of the vehicle I'm driving when I enter a lua trigger. The only thing I'd like to modify is to have the prop to appear a small distance ahead of the vehicle. I suck at lua (and math) and I can't seem to figure out how to modify the code. Particularly, I'm not entirely sure what the "getDirectionVector" values are pointing to. Here's the code so far: Code: local function teleportProp(data) local player = be:getObjectByID(data.subjectID) local prop = be:getObjectByID(00000) local position = vec3(player:getPosition()) local forward = vec3(player:getDirectionVector()):normalized() position.z = position.z + 3 local coordinate = forward * 2 + position if data.event == 'enter' then prop:setPosition(coordinate) end end return teleportProp
Solved this myself. For anyone wondering you just change the multiplier in this line: Code: local coordinate = forward * 2 + position For some reason, when using this with a lua trigger was giving me wacky results, so I dismissed that as an option.