Issue with moving a rig position through local script

hey guys this is a really dumb question but i couldnt find any answers to it online (unless im very blind) so i created this post, basically im creating a rig clone through a local script and i want to change its position to very specific coordinates, it howevers doesnt work as the rig is a model, and i dont know what to do, i appreciate any help given

	local rig = ReplicatedStorage:WaitForChild("AvatarEditorCharacter")
	rig:Clone()
	rig.Parent = workspace
	rig.Position = "480.75, -59, 105"

i forgot to clarify that i also tried to use a for loop through all the rig childrens to change their position but it doesnt work either

local newPosition = Vector3.new(480.75, -59, 105)
for _, part in pairs(rig:GetChildren()) do
    if part:IsA("BasePart") then
        part.Position = part.Position + newPosition
    end
end

For positioning a model, I would use :PivotTo(). This method requires an parameter which is the destination but in CFrame.

Basically:

local newCFrame = CFrame.new(480.75, -59, 105)
rig:PivotTo(newCFrame)

Hope this helps!

Also, you can’t just position something like this. The Position property is a Vector3 value, which means

rig.Position = Vector3.new(480.75, -59, 106)

The value you typed here is called string value.

Life saver, thank you so much, also yeah i completely forgot about that, my bad lol.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.