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

Rotat a GameObject and than shoot it in the New (x) direction

$
0
0
hello my Name is Ammar i am new with C# that is why i have a problem with this code because i want to rotate the Game object and after that shoot it in the new (x) direction. please Help me and thank you void Start() { { rb = this.GetComponent(); } } void Update() { transform.Rotate(0, ballrotaion * Time.deltaTime, 0); if (Input.GetKeyDown(KeyCode.Mouse1)) { rb.AddForce( new Vector3(speed,0,0 ) ); } }

Viewing all articles
Browse latest Browse all 1264

Trending Articles



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