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;
}
↧