SO WHAT IM TRYING TO DO IS TO MAKE THIS NPC FOLLOW A PLAYER BUT IT ENDS UP WITH THIS
ERROR (JUST SAYING IM USING PATHFINDING SERVICE)
THIS IS THE SCRIPT:
THIS IS THE ERROR:
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I TRYED TO THE CHANGE POSITION WITH CFRAME BUT DIDNT WORK
5smokin
(KingVamp)
September 4, 2024, 2:09pm
#3
The player’s character does not have CFrame, you should get the HumanoidRootPart Instead.
Here is how you can do it:
path:ComputeAsync(rig.PrimaryPart.CFrame, player.Character.HumanoidRootPart.CFrame)
for some reason my non player character is not moving still
5smokin
(KingVamp)
September 4, 2024, 2:14pm
#5
Do you get any error messages?
i do have an error message:
Workspace.AngryRig.Script:23: attempt to index nil with ‘HumanoidRootPart’
5smokin
(KingVamp)
September 4, 2024, 2:17pm
#7
local character = player.Character or player.CharacterAdded:Wait()
path:ComputeAsync(rig.PrimaryPart.CFrame, character:WaitForChild("HumanoidRootPart").CFrame)
I have added few changes to the previous code.
it also didnt work and i will be back after a couple of minutes
5smokin
(KingVamp)
September 4, 2024, 2:27pm
#9
Do you get any error messages again?
i go this error:
Unable to cast CoordinateFrame to Vector3
5smokin
(KingVamp)
September 4, 2024, 5:45pm
#12
Seems like they arrays needs Vector3 and not CFrame:
path:ComputeAsync(rig.PrimaryPart.Position, player.Character.HumanoidRootPart.Position)