- Home /
How do I create a vector that always points down locally
So if I do this:
if(Input.GetButton("Kick1")) {rigidbody.velocity = Vector3.down * kickForce;}
When I press the key, no matter what is the rotation, the cube goes down, but I want it to go to where his bottom is facing...
Anyone knows how its done?
Comment
Answer by robertbu · Apr 14, 2014 at 01:36 AM
Use '-transform.up' in place of 'Vector3.down'. '-transform.up' will be the local down of the object translated into world space.
if(Input.GetButton("Kick1")) {rigidbody.velocity = -transform.up * kickForce;}
thank you very much dear friend. Btw in the code, u put -transform.down ins$$anonymous$$d of up, But I understood it anyways.
@The_Baz please select the 'Accept this Answer' to earn some karma for yourself and robertbu
@The_Baz - yep I messed up. 'transform.down' does not exist, so you have to use '-transform.up'.
Your answer
![](https://koobas.hobune.stream/wayback/20220613142644im_/https://answers.unity.com/themes/thub/images/avi.jpg)