Quantcast
Channel: Latest Questions by Fox-Handler
Viewing all articles
Browse latest Browse all 90

Constraining rotation to only the Y Axis

$
0
0
I was trying different bullet patterns for a shooter game, and noticed that the rotation on the Z axis has problems when there is movement on the player using a rigidbody,so the bullet patterns disappear/fade out when the player actually moves. Is there a way to fix this I've tried using transform.rotation = Quaternion.Euler(0,20,0) to limit the rotation to only the y axis, but it feels a little messy. Is there an easy fix to this problem? // Update is called once per frame void Shoot () { Instantiate(bullet,transform.position,transform.rotation); } void Start() { rigidbody.velocity = transform.forward * speed; }

Viewing all articles
Browse latest Browse all 90

Trending Articles



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