I’ve been looking around for an answer and nothing I tried seemed to work. Any recommendations or help would be appreciated!
So I just figured out how to rotate the enemy to face the character during part of the animation.
First, we use a AnimNotifyState. I called it “rotatetofaceplayer”. I put that in the animation montage, setting the start and end. Then, within the AnimNotifyState, I overrode its begin notify and end notify functions, I got the meshes ai controller, and implemented an interface that would send a message to the AIController basically setting a bool that would run either a set focus function or clear focus function.
I’ll look into moving the enemy towards the character during part of the animation, probably tomorrow, as it’s getting late for me.
Edit:
I figured out a mostly decent solution to move the character.
I had the animation set up so that it would go a certain distance with its root animation, and I considered that its max distance for its movement during that part of the animation. If the player was at a distance less than the range of the root movement length then I would have the enemy motion warp to the character, so that it wouldn’t move past the character. Also, the motion warp would only play when I called a montage notify. Off the play montage, I set the motion warp to get the player’s location on notify begin. You can also set multiply montage notifies and switch based on the name, using the node at the bottom of the play montage.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.