local dummy = workspace.Dummy local dummy2 = workspace.Dummy2 local dummyhum = dummy.Humanoid dummyhum:MoveTo(dummy2.PrimaryPart.Position)
Hi I am trying to move "Dummy" to "Dummy2" which is stationary in my workspace. Please help I am unsure of why my code does not work!
Why don't you just use CFrame?
local dummy = workspace.Dummy local dummy2 = workspace.Dummy2 local dummyhum = dummy.HumanoidRootPart --You can't move a Humanoid. Only RootPart. dummyhum.CFrame = dummy2.HumanoidRootPart.CFrame
Always remember, when moving a player or a rig, move the HumanoidRootPart
, never the Humanoid
itself. Humanoid is only for player / rig Properties
.
Also remember to simplify your techniques. Roblox Characters already have attachments
inside of them, so you can just use CFrame
to move them about. CFrame
(s) work better in situations requiring characters.
Here's an alternate script that explains what I commented, below.
local dummy = workspace.Dummy local dummy2 = workspace.Dummy2 local dummyhum = dummy.PrimaryPart dummyhum.CFrame = dummy2.PrimaryPart.CFrame