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

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

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

4 comments

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.

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.

0

sovled it

0

I think the easier solution is to weld other parts to the primary part.

1 answer

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.

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