Quantcast
Viewing latest article 4
Browse Latest Browse All 16

rigidbody.AddForce(transform.forward * 5000)

I am making a simple first person game. I created a simple move script that i would build upon. I am using the MouseLook script from the character controller package. I am using rigidbody.AddForce to move my character around. I use this code to move my character forward: rigidbody.AddForce(transform.forward * 5000). It works fine but the only down side is if I look up and call that code it enables me to fly. I don't want that to happen. Is there a way to restrict the forward to only the y axis. I just want it to move forward in the y direction my character faces. Is there a easy way to fix this or use a different way to do this instead of rigidbody.AddForce.

Viewing latest article 4
Browse Latest Browse All 16

Trending Articles



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