Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I re-position unions?

I'm trying to re-position a union via a script, but when the union spawns into workspace, it just stays at point (0,0,0). There's no error in the output, so idk whats going wrong. Here's the script:

script.Parent.ClickDetector.MouseClick:connect(function(plr)
	local player = plr.Name
	local action = plr.PlayerGui.Menu.Selected.Item.Value
	local item = game.ReplicatedFirst.Items:FindFirstChild(action)
	item = item:Clone()
	item.Parent = script.Parent
	if item:IsA("UnionOperation")then
		item:MoveTo(Vector3.new(script.Parent.Position))
	end
end)

All help is appreciated.

1 comment

0

Is your Union anchored ?

1 answer

✓ Accepted answer

MoveTo isn't actually a method of unions (nor is it a method of parts). You can only use MoveTo on models and humanoids.

To move parts and unions around, just use their Position property.

workspace.Union.Position = Vector3.new(x, y, z)

This discussion is preserved as it was. New answers, comments, and votes are closed.