I'm trying to make a part that will follow the mouse, this part works, however an NPC is meant to follow the part that follows the mouse. The only problem is that it goes to the original position of the part, instead of following it. (By the way theres a keybind that activates the movement, and it moves the part into the workspace so it's not longer in the replicated storage) Here's the script:
local GoHere = game.ReplicatedStorage.GoHere while wait() do script.Parent.Humanoid:MoveTo(GoHere.Position) end
You haven't given much surrounding context so I'm going to assume that you have cloned the part from ReplicatedStorage
into Workspace
and modifying its position from there.
If that's the case, the reason the humanoid is only moving to the original position of the part is because the target part in ReplicatedStorage
and Workspace
are different. Use the position property of the part in Workspace
instead.
```lua local GoHere = workspace.GoHere
while true do wait() script.Parent.Humanoid:MoveTo(GoHere.Position) end ```