Make npc face player while moving

Hello! I made an npc ai and made it strafe when shooting in order to dodge enemy fire. But I want the npc to constantly face the player when shooting and if I set the cframe of the npc it’ll make the strafing jittery since it will constantly be setting the npc’s cframe when the npc is trying to walk. How would I make the npc face the player whilst moving?

You’d have to make a separate animation for sideways movement. You can make the NPC face the player through:

CFrame.new(npc.Position, plrbody.Position)

Try making the joints move instead of the characters cframe, its not going to be easy but its worth a shot

I’ve tried the CFrame method, it results in a jittery movement for my character. I’ll try the animation method however, thanks!

The animation method sadly hasn’t worked, I suspect the reason it didn’t work is due to the fact that my strafing works by moving the character left or right relative to their cframe, so when the npc moves to the left of them, their character faces the spot they’re walking to and the next time they strafe they move to the left or right of that spot. In simpler terms since I don’t want to overcomplicate things since I sometimes do that, the animation method didn’t work.

@Pooglies About that method, any good tutorials you can point me in the direction of? I had an idea using your method which was to make the npc torso face the player.

That won’t work. It will just force the NPC to stay in place. Althought it will make the NPC face the player. But it won’t make the npc able to move

That happens because of server-client delay which is caused by internet connection.

Try using it on client-side instead of server-side.