Hi this is Fender and I’ve been experimenting with tank movement but when it comes to the movement of the turret in a slope, it’s x and z rotation is wrong.
also if I switched to local Rotation, its all different and not what I want.
so here is the main code:
public class TurretRotation : MonoBehaviour
{
public Transform turret;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void FixedUpdate()
{
turret.rotation = Quaternion.Euler(0, Camera.main.transform.eulerAngles.y,0).normalized;
}
}
also I’m using "“Cinemachine” and my age is 12 so if you can help me that would be greatly appreciated.