Hello i am trying to get NPCs to fight each other based around attack distances something i have noticed is sometimes the NPCs move slightly to far causing the NPCs to appear facing back to back. I have programmed them to have no walkspeed if they are within attack radius and am trying to get them to correct them selves using ":SetPrimaryPartCFrame()" but i keep getting this error "Unable to cast Vector3 to CoordinateFrame"
Heres the line of code:
child:SetPrimaryPartCFrame(HRP.Position - eHRP.Position)
If anyone knows how i can adjust this to get it to function like it is suppose to I'd really appreciate it.
P.S: I have tried using:
child:SetPrimaryPartCFrame(HRP.Position.X - eHRP.Position.X,HRP.Position.Y - eHRP.Position.Y,HRP.Position.Z - eHRP.Position.Z)
And it still doesn't want to work (same error)
THIS IS NOT A REQUEST

1 comment
Had an error there, forgot to add something, but I've edited the code