Model doesn't rotate with Primary Part

  1. What do you want to achieve? Keep it simple and clear!
    I want my model to rotate with the primary part.

  2. What is the issue? Include screenshots / videos if possible!
    The primary part rotates but not the rest of the model.

local Variables = script.Variables -- A folder with bool values
local Canopy = script.Parent.Canopy -- Model

Variables.Canopy:GetPropertyChangedSignal("Value"):Connect(function()
	if Variables.Canopy.Value == true then Canopy.PrimaryPart.Orientation = Vector3.new(0, 0, 65) return end
	if Variables.Canopy.Value == false then Canopy.PrimaryPart.Orientation = Vector3.new(0, 0, 0) return end
end)

You would have to weld all the model’s parts to the primary part or use model:PivotTo() in a for loop

Have you tried weld the parts to the primarypart?

So like this?

for i,v in pairs(Canopy:GetChildren()) do
		Canopy:PivotTo(v)
		v.Orientation = Vector3.new(0, 0, 65)
	end

Yeah they are welded with weldconstraints since welds will teleport the part to the center of the other object for some reason.

No i meant using a for loop if you would make the rotation like a tween but i didn’t see it was in an event

So just use :PivotTo() on the model

So this

Canopy:PivotTo(Canopy.PrimaryPart.CFrame)

or

Canopy:PivotTo()
1 Like

If Canopy is a Model, u can use :PivotTo(object.CFrame), No need to loop through the children of it, since it will automatically bring them with it.

1 Like

alright and then do I just add .Orientation = Vector3.new(0, 0, 65) onto it so like

:PivotTo(object.CFrame).Orientation = Vector3.new(0, 0, 65)

1 Like

This would work

local model = workspace.Model
local currentPivot = model:GetPivot()
local newPivot = currentPivot * CFrame.Angles(0, 0, math.rad(65))

task.wait(5) -- Test purposes

model:PivotTo(newPivot)
1 Like

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