Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I rotate a mesh parts so it stays together?

Asked by 4 years ago
Edited 4 years ago

So I am trying to rotate all three mesh parts at the same time but also so the shape stays intacted here my script:

local CB = script.Parent.CoffeeBody
local CT = script.Parent.CoffeeTopp
local CH = script.Parent.CoffeeHandle

while wait() do

    CB.Orientation = CB.Orientation + Vector3.new(0,.1,0)
    CT.Orientation = CT.Orientation + Vector3.new(0,.1,0)
    CH.Orientation = CH.Orientation + Vector3.new(0,.1,0)

end

it rotates it but it does not do it all together it rotates each one separately so it does not stay in tact

0
You can do this by putting them into a model, and then use Model:SetPrimaryPartCFrame(CFrame) to rotate everything around the Primary Part of the model that you can set. mynameisdaniel0 0 — 4y
0
I try doing that but it didnt work and it teleported it like a few blocks away from its original spot can you get me a sample code or like a example because I tryed to but it ended up not working. vortex767 20 — 4y
0
sovled it vortex767 20 — 4y
0
I think the easier solution is to weld other parts to the primary part. IceyTazeForLife 253 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

So what you could do is model the 3 seperate parts by holding shift and clicking and selecting all three.

However you should put something in the direct center of it all, select that part as well with the 3 other parts, and make it a model.

Go to view, go to properties, select the model, and in properties it should say "PrimaryPart". Press that, then press the block in the center.

Enter a script by right clicking the model, press select object, type script, and press to insert. Then proceed to type:

while true do
script.Parent:SetPrimaryPartCFrame(script.Parent:GetPrimaryPartCFrame()*CFrame.fromEulerAnglesXYZ(0,0,0))
wait()
    end

Change the AnglesXYZ(0,0,0)) To the axis you want, so like .1,0,0 should spin on the X axis if I am correct.

After that it should be done.

Ad

Answer this question