local dum = game.Workspace.Dummy game.Workspace.Part1.Touched:Connect(function(hit) for _, v in pairs(dum:GetChildren()) do print(v) if v:IsA("Humanoid")then dum.HumanoidRootPart.Position = Vector3.new(0,0,0) end end end)
thats my npc teleportation code, i have moveto code to move Dummy but when dummy touches the teleportation part its spininng doing everything except teleporting 0,0,0
i think the issue is when dummy teleporting teleports just HumanoidRootPart. When the dummy touches teleportation part HumanoidRootPart teleporst well but other thing like leg and torso doesnt teleport and it makes 2 separate parts HumanoidRootPart and other body parts. I cant do Anchored enabled because if i do that my moveto code doesnt work.
Here is what you can do, You can go and use SetPrimaryCFrame to move the NPC.
game.Workspace.Part1.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent:SetPrimaryPartCFrame(CFrame.new(0,0,0)) end end)
You can read up more on SetPrimaryCFrame here:
Hope this has helped :)