void aimPlayer() { diff = (-(playerTransform.position - myTransform.position)).normalized; float zRotation = Mathf.Atan2(diff.y, diff.x) * Mathf.Rad2Deg; muzzle.setRotation(Quaternion.Euler(0, 0, zRotation - 90)); }
void changeRotation() { muzzle.setRotation(Quaternion.Euler(0, 0, Random.value * 360)); }
void rotateMuzzle() { muzzle.setRotation(Quaternion.Euler(0, 0, muzzle.getRotation().eulerAngles.z + angleDiff)); }