Question by
mutant pizza · May 10, 2016 at 05:57 AM ·
vector3direction
Transform.forward * vector3
In short I'm using .AddForce with transform.forward but I want to cancel out the vertical axis... I know how to achieve this however I can't get the syntax right...
rigidbody.AddForce(transform.forward * speed * Vector3(1, 0, 1));
The only other post I've been able to find is this post, that unfortunately doesn't help much Thanks in advance :)
Comment
Best Answer
Answer by tanoshimi · May 10, 2016 at 05:59 AM
rigidbody.AddForce(new Vector3 (transform.forward.x, 0, transform.forward.z) * speed);
Your answer
Follow this Question
Related Questions
Lerp between two direction vector 0 Answers
Snap direction to angles + shifting 0 Answers
How to make a object move forward when is rotated. 0 Answers
ClampMagnitude while ignoring a direction 0 Answers
change angle towards direction 1 Answer