Quantcast
Viewing all articles
Browse latest Browse all 64

Add force in the camera direction??

I want to addforce in the direction that the camera is facing. The only problem is that the camera is slightly pointing down. So if I go backwards, the ball starts the float a little. I am currently using: `var moveRelativeVerticalRaw : Vector3 = camera.main.transform.forward * Input.GetAxis("Vertical");` `rigidbody.AddForce(moveRelativeVerticalRaw / 2, ForceMode.Impulse);` but again this adds force in the camera's tilted direction :( So basically, I guess how would I make it so that the force applied is parallel to the ground?? or, is there any other way of doing this?

Viewing all articles
Browse latest Browse all 64

Trending Articles



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