I want to get turning in place animations for my ai, but every bit of documentation ive seen has either been incredibly vague or only works with player animations. the main step that is show in most documentation or tutorials that is impossible with an ai character is getting the rotation via mouse input in the player code (screenshot for refrence:)
would there possibly be any way to get the ai’s rotation, or am i gonna have to scrap the turning animations all together (that would suck because i spent a couple hours making turning animations, and it would suck for them to go unused).
Any help would be appreciated!
The AI’s rotation is the capsule’s rotation. If I understand correctly, you mean to rotate the AI using root motion locomotion? If so, I don’t believe you can as that would require external movement input (e.g. mouse movement, camera movement).
One solution might be to use a ‘Look At’ node within the AI’s ABP to make its head follow the player or an object of interest. Then maybe you can calculate the dot product of a forward vector based on a set of sockets (scene components) in the head and face with the AI capsule’s forward vector to determine when its head is so many degrees left or right of forward. From that trigger an event/montage.
Not sure how feasible it is, but UE is usually forgiving when the logic is sound.