Hi friends
I use 2D physics, imagin i have an spaceship object which it’s head is toward right direction ( z angle = 0 degree )
I have this code to move my object forward ( to right side ):
if action_id == hash("up") then
msg.post('.', "apply_force", {force = vmath.vector3(50, 0, 0), position = go.get_world_position()})
end
it’s ok while it’s not rotating, after it rotates i need to get new z angle and change direction of force towards its head ( to push it forward not to right )
how should i change my force vector?
- how you write lua codes in forum that it looks beautiful not like normal texts, is there any tag for it? ( instead of copy and paste directly )! ( answered )