How to attach actor's speed to it's direction
I'm not sure how simple question this question is: I'm trying to have an object change direction when I rotate it, but since velocity isn't attached to a direction I'm not sure the best way to achieve thir.
I don't want my actor to drift like in the Space Rock or car template.
I don't want my actor to drift like in the Space Rock or car template.
Comments
But then when I rotate my actor, the speed won't follow actor's direction but only it's acceleration will so the actor will drift instead of just turning. I would like the actor's velocity to follow actor's direction when I'm rotating it.
I can achieve this by having a very high acceleration with a max speed, but then I won't be able to normally accelerate. There must be a better way to do this.
when button is pressed change linear.velocity.X to 0 and linear.velocity.Y to 0 then have your accelerate behavior after that. That way it stops and then goes towards the new direction. May want to use move with this or just change velocity.
Since I want an acceleration, reseting velocity to 0 will just stop the actor every time I turn. Adding a lot of drag doesn't seem to change anything.
I guess using velocity with a direction might require some mathematical equation or something.
Cheers!