Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

Force Not Being Added in Correct Direction

$
0
0
I have a projectile, which is supposed to be firing in the direction of the camera. I've been trying for hours now but I still haven't figured it out. I am very new to Unity and some help would be much appreciated. Bullet.GetComponent ().AddForce (Camera.main.transform.forward); The code above is what I'm using to Add Force in the direction of the camera. It adds the force perfectly fine, but not in the right direction. The force is being added directly upwards instead of towards where the camera is pointing. Could someone possibly tell me why this might be happening?

Viewing all articles
Browse latest Browse all 1264

Trending Articles



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