- Home /
rigidbody.addforce forward locally?
How do i apply rigidbody force on the local Z axis?
Answer by Kryptos · May 16, 2012 at 11:55 AM
You get the local z axis, with transform.forward
:
Vector3 v3Force = strength*transform.forward
rigidbody.AddForce(v3Force);
Answer by TyJake · Oct 17, 2014 at 07:12 PM
I'm pretty sure that this is what most (noobs) searching on this subject are looking for.
AddRelativeForce.
Yes...sometimes it is THAT simple. :) Don't worry..it has racked the brains of most of us non "natural" coders.
rigidbody.AddRelativeForce (Vector3.forward * 10);
yep thats me. been using unity for six years and yet somehow i was that exact noob right now
lol i struggled for 1 hour searching for a solution then i found that i already had it i just didn t add enough force to move the object.
So I'm so noobish that I'm still confused here, haha. In this case I want to take however much the Input.GetAxis ("Vertical") is, and I want that to be the force being added forwards. In your case, you're adding the force of Vector3.forward, and I don't know what that means. Mind helping?
Your answer
![](https://koobas.hobune.stream/wayback/20220613071542im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
AddForce doesn't work when used with velocity 3 Answers
Rigidbody Character 1 Answer
Reading the forces applied on a freezed rigidbody(solved) 1 Answer
Unity First person controller force and mass 0 Answers
maximum torque/maximum force 0 Answers