Hey guys I have this problem with my enemyAi where when I am in a certain distance and in his field of view he will look at me.
But if I am in that distance and in his field of view and I jump he will also turn vertically, its hard for me to describe since english is not my native language.
Could you guys help me? I don’t know how to let the enemy rotate only his Y and not his X and Z
I think I did something like this with forks in my game Party Business.
What I did was calculated the goal rotation like you did here, then I used Eulers to combine just the .y value of the Euler with the current rotation. Something like this but I may be remembering wrong:
//set newrotation with lookrotation
//set oldrotation to current rotation
//then combine the two
Quaternion adjustedrotation = Quaternion.Euler(oldrotation,eulerAngles.x,newrotation.eulerAngles.y,oldrotation.eulerAngles.z);