- Home /
Add force problem
So, i'm making flying physics for spaceship... What i want to do is when i hold W, i want the force to push me from it's back, so when i rotate his nose to up, it's gonna start pushing him up... Right now what i have is just pushing it forward no matter what rotation there is... How would i do this ? Here's a photo that might explain it better:
Also, here's a code i use to go forward:
SpaceShipTransform.gameObject.rigidbody.AddForce(Vector3.right * Time.deltaTime * ForwardSpeed);
And this is the one i use to rotate the nose:
transform.RotateAround(transform.position, -transform.up, Time.deltaTime * PullSpeed);
Answer by MrSoad · Nov 30, 2014 at 01:21 PM
Vector3.right is in world space and will always give the same result. You need to use local space : transform.right
I figured it out myself before, and that was it, thanks anyways :)
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Rotating an Arrow 2 Answers
C# Water Rotation 0 Answers
Rotating child doesn't move parent Rigidbody? 1 Answer
How to set velocity to new direction after rotation? 0 Answers