I’m trying to get the amount the player has rotated along the XZ plane and disregard the Y axis. The code I’m using now takes all three axes into account. Anyone have any ideas?
void Start()
{
player = GameObject.FindGameObjectWithTag("MainCamera");
playerGhost = new GameObject();
playerGhost.transform.rotation = player.transform.rotation;
}
void Update()
{
if (Vector3.Angle(playerGhost.transform.forward,
player.transform.forward) >= 45)
{
//DO STUFF
playerGhost.transform.rotation = player.transform.rotation;
}
}