Actor only looking in one direction when rotation is set using Find Look at Rotation

Hello,

I am trying to set the rotation of an actor in my level to face my player after a randomised delay (using a min and max float) after the player has entered a volume component atached to the actor. The delay works fine and the Set Actor Rotation fires off, but regardless of where my player is at the time, the rotation of the actor is always the same (and never toward the player).

I have attached my set up in Blueprint for the look at code, and have attached the two set ups of the involved actors (orange character is the Actor being told to look at the white character, which is my player). The direction the orange actor is facing in the last screenshot is the direction the actor always looks in when the player enters the volume.

Thanks in advance

It seems when I created my enemy class I used the Pawn base class instead of a Character. That seems to be causing me some issues, I also found that the mesh is not facing the same way as the capsule component in the enemy actor. I’m going to investigate these issues (and likely remake the enemy class from a duplication of the Third Person Character blueprint). Will report back with results.

If you’re only going to use 1 pin, it should be the Z :slight_smile:

Ok, sorry, my bad, I just assumed you wanted it to look left / right, which would be most typical… :slight_smile:

I’ve just looked up some code I have for this, I have the exact ( basically ) same thing as you except when I come to set the rotation, I use SetWorldRotation.

Hoorah! :slight_smile:

Z is pointing upwards. So Z rotation is ‘around’ the vertical axis.

Why is that exactly? The actor is still rotating on the axis I want it to.

Hmm, I do have the character looking left / right to adjust its view toward the player, even though it’s not plugged in to the Z. I’m still in the process of moving the enemy over to a character and not a pawn so that it inherits movement and has the correct component rotation etc. I’m hoping this solves the issue.

I am still having the issue after moving the class across to a Character. Now the character is facing a different way (behind), again not effected by the player’s actual position.

I have to apologise Clockwork cause you were absolutely right in that it was the Z pin I should have been using, and it has fixed the issue for me instantly.

Firstly - thank you very much!

Secondly - could you explain this to me? I was under the impression that Z rotation would be the up and down, and Y would be the left and right. Is it different for characters or in Unreal perhaps? I have clearly crossed some wires in my understanding! TIA.

I’m with you! I thought it would be rotating up and down, like it does in translation. Good to know - thanks again!