How To Add a local force
I am trying to make a small plane fly. I already have a pawn, applied physics and now it falls to the ground and collides. Now I set up PlayerInput that would let the player apply a force by the press of a button. The problem is, when I press play and steer the plane in an upwards direction (by using AddTorque) the plane still gets pushed In a horizontal direction. What can I do to fix this and how do I apply the force correctly and locally? I tried using AddForceAtLocation, but then the pawn just started spinning uncontrollably.
This is my code:
asked Jul 20 '15 at 01:00 PM in C++ Programming
This is a little old, so you may have figured it out, but I think you need to use the GetActorForwardVector() and multiply it by the thrust, usually a float I guess, instead of setting the X component of the vector to 5000. I believe that makes it go in the X direction relative to the world.
Follow this question
Once you sign in you will be able to subscribe for any updates here