Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

I don't understand what I'm passing to addTorque

$
0
0
in this snippet: void FixedUpdate () { float h = Input.GetAxis("Horizontal") * amount * Time.deltaTime; float v = Input.GetAxis("Vertical") * amount * Time.deltaTime; rigidbody.AddTorque(transform.forward * h); rigidbody.AddTorque(transform.right * v); } I'm having a lot of trouble getting my head around what's going on. I know h and v are just floating point values returned by GetAxis. I've watched the tutorial on getaxis and have played with it a bit to get a sense for how it works. What I don't understand is what transform.up/right/forward actually is, or what happens to it when I use the multiplication operator with it.

Viewing all articles
Browse latest Browse all 171066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>