All children teleport except for accessories?

So basically, I have a game where the dummy needs to teleport to a new spot if you click a button. All parts of the dummy teleport except for any accessories it has. I would know how to teleport the accessories, but I don’t know how to reference each accessory. Can anyone help?

How I teleported all the children:
I know its messy but if I got all the children and toldthem to tp to one spot then all the parts of the Dummy would combine toghether.

Video if my explaining is confusing:

    Dummy.Head.Position = game.Workspace.Claw.DummyPos.Head.Position
	Dummy.HumanoidRootPart.Position = 
    game.Workspace.Claw.DummyPos.HumanoidRootPart.Position
	Dummy["Left Arm"].Position = game.Workspace.Claw.DummyPos["Left Arm"].Position
	Dummy["Left Leg"].Position = game.Workspace.Claw.DummyPos["Left Leg"].Position
	Dummy["Right Arm"].Position = game.Workspace.Claw.DummyPos["Right Arm"].Position
	Dummy["Right Leg"].Position = game.Workspace.Claw.DummyPos["Right Leg"].Position
	Dummy.Torso.Position = game.Workspace.Claw.DummyPos.Torso.Position
	Dummy.leftArmWeld.Position = game.Workspace.Claw.DummyPos.leftArmWeld.Position
	Dummy.leftLegWeld.Position = game.Workspace.Claw.DummyPos.leftLegWeld.Position
	Dummy.rightArmWeld.Position = game.Workspace.Claw.DummyPos.rightArmWeld.Position
	Dummy.rightLegWeld.Position = game.Workspace.Claw.DummyPos.rightLegWeld.Position
	Dummy.torsoWeld.Position = game.Workspace.Claw.DummyPos.torsoWeld.Position

if anyone has any tips, please let me know, thank you!

Why are you manually adding each part of the character… Can you not just loop through all the children of the character model and then just teleports all of them over?

Wouldn’t I end up with something like this?

image_2023-01-25_080948232

all parts of the dummy tp’d to one part so it combines the parts toghether?

Wouldn’t it be easier to simply move the HumanoidRootPart to the spot?
Like if you set the HumanoidRootPart’s CFrame to the area every other part of the character will move along without issues.

2 Likes

Woah, why are you setting the position of each part? Wouldn’t Dummy:MoveTo(...) be enough?

(Correct me if I’m wrong)

Ohh I had no idea you could do that, I’ll try it out.

Issue with :MoveTo() is that it makes the character walk over to the place set (or at least I think this is what MoveTo does). The user wants them to teleport the user over.

I had no idea also that there was a :MoveTo() command (I’m not much of a scripter but still trying to make this game solo.

tried doing that and it only moved the humanoidrootpart, not any other child in dummy.

Good start?

local GetAccessories = Dummy:GetChildren()
	if GetAccessories:IsA("Accessory") then
		
	end

What about getting the actual Dummy (Model) and do :PivotTo() on it for example Dummy:PivotTo(300,20,1)?

1 Like

Tried this: Dummy:SetPrimaryPartCFrame(game.Workspace.Claw.DummyPos.HumanoidRootPart)

but I get this error “Unable to cast Instance to CoordinateFrame”

Is the models primary part the HumanoidRootPart?
if yes something this simple should work.

local button = script.Parent
local dummy = workspace.AlreadyPro

button.MouseButton1Click:Connect(function()
dummy.HumanoidRootPart.CFrame = workspace.Part.CFrame * CFrame.new(0,5,0)
end)

I mean you would need to do a for i, v in pairs() loop on the variable called “GetAcessories” so you loop through all the accessories they have.

If you were to do it the way it was done first then yeah, but since they wanted to have the entire character moved to another location it would really not be necessary unless the rig got messed up.

Tried something similar to that, but realized it was just getting rid of the HumanoidRootPart for some reason???

Dummy.HumanoidRootPart.CFrame = game.Workspace.Claw.DummyPos.HumanoidRootPart.CFrame

And when you look at the dummy is the primary part the humanoidrootpart?

1 Like

thank you! The CFrame part of the script worked but my only issue was that the dummy that was being duplicated wasn’t in the right position…

like looking the wrong way? if so i would think rotating the rope/game.Workspace.Claw.DummyPos.HumanoidRootPart to the right position should help.

no, I had it at like a different section of the map but when I moved it to where all the dummies where being tp’d it worked.

1 Like