What do you want to achieve?
I want to make an NPC that chases you when you get near it, and it attacks you and has animations
What is the issue?
I’m not really sure what to start with. I’m not really a scripter, so I have trouble with knowing how to start it.
What solutions have you tried so far?
I have looked up other Dev Forum Posts, and YouTube videos, but nothing is appearing helpful to me.
I’m not asking anyone to create a whole script for me, just to help with what key points I need to add to make it all work.
The character is an Orc, from Lord of the Rings. I am trying to make it that when you are near it, it chases you, and it has a sword out. Then once it touches you or gets in a certain distance, it attacks you with a sword. Thank you everyone!
Ideally use pathfinding so the NPC won’t get stuck behind objects.
Use magnitude to figure out how close the NPC is to the player. When the player is within a specified range then play the attack animation.
Ideally, pathfinding should only be used when the npc has obstacles. Through casting a ray from the humanoidroot part or head and determining. If there isn’t just use normal Humanoid:MoveTo(), else use pathfinding to the nearest player.