Rotating the PrimaryPart of a model that has Weld Constraints

I’m making a plane system and would like one of the things to rotate when the plane is turned on. The issue I currently have is my model wouldn’t rotate when I run the following line of code:

for i = 1, 45 do
    Left:SetPrimaryPartCFrame(Left.PrimaryPart.CFrame*CFrame.Angles(0,0,math.rad(2)))
	Right:SetPrimaryPartCFrame(Right.PrimaryPart.CFrame*CFrame.Angles(0,0,math.rad(2)))
    wait()
end

All of the parts in the model have Weld Constraints to the Main holder part. Based on what I read online, many sources say to use Motor6D. If this is the case, then how’d I go about using it?

Thanks.

1 Like

are your parts that weld to the main holder part unanchored?

Yes, all the parts are unanchored.

1 Like

not relating to solving the problem but if youre doing it that way that means its unnecessary for you to have a primarypart of your model because the main holder part will be your ‘primary part’, try this code

for i = 1,45 do
Left.pivotname.CFrame = Left.pivotname.CFrame*CFrame.Angles(0,0,math.rad(2))
Right.pivotname.CFrame = Right.pivotname.CFrame*CFrame.Angles(0,0,math.rad(2)) -- it should stop 90 dgres
wait()
end

Would you mind telling us what Left and Right are?

The model names ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

And I am assuming that you have assigned the primary part of each model?

Just tried it and no luck, it’s the same result as before. I had all of my WeldConstraint’s attached to the pivot of the Left and Right models with those pivots being attached to the Holder part.

1 Like

are there any errors in the code or are you sure every part is unanchored except for the main holder?

The main holder part isn’t anchored, it’s an unanchored part using a BodyVelocity. (Every part is unanchored)

There’s no errors at all.

1 Like

I don’t know if this is part of the problem, but this is also happening through a LocalScript.

1 Like

So if you were to insert a print function into the loop, that prints the rotation of the PrimaryPart, what does it say?

The Local Script doesn’t seem to be a factor as when I test it the entire model shakes instead of the two wing spots for the certain amount of time that the for loop would last.

1 Like

if thats the case then…, turn off cancollide to the parts that would collide from the rotating parts if that would help?

Nothing changed. ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

1 Like

The model shakes showing that it’s turning, but the actual two models that need to turn aren’t turning; if that makes sense.

1 Like

How are those two models connected to the root model?

Weld Constraints. ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌ ‌

That might be your issue. I’m not entirely sure, but from what I can tell from the API, it sounds like if you try to update the CFrame of one welded part, it will do the same for parts welded to it. This could imply that it is trying to rotate the entire model due to it all being connected by welds, rather than just the part that you want.
WeldConstraint (roblox.com)

1 Like

Ah, I see now.

What would my alternative to Weld Constraints for the two models be? How would I execute it?