Quantcast
Channel: Questions in topic: "gun"
Viewing all articles
Browse latest Browse all 592

Unity c# Raycast axis stuck on one axis

$
0
0
I DID use transform.forward instead of a Vector3.forward, and whilst it is rotating fine on the x axis, whenever I aim up and down it won't rotate on that axis, it just sort of "slides" up and down with the barrel gameObject it is referencing. public GameObject barrel; void Update () { weaponSystem(); } void weaponSystem() { //Weapon System for GUN //------------------------------ Debug.DrawRay(barrel.transform.position, transform.forward * weaponRange); Ray gunRay = new Ray(barrel.transform.position,transform.forward * weaponRange); }

Viewing all articles
Browse latest Browse all 592

Trending Articles



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