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

How do you create rotating models?

Asked by 4 years ago

In my obby game, I'm replicating the "DOOMBALLS" section from "Tower of Hell". It is basically a flat cylinder inside of a sphere that rotates, forcing you to maneuver yourself around to the next ball. I made a model with a sphere and cylinder inside, setting the sphere as the primary part. Then I put this code into the model

while true do 

    script.Parent:SetPrimaryPartCFrame(script.Parent:GetPrimaryPartCFrame()*CFrame.fromEulerAnglesXYZ(.1,.0,.1))
    wait()
    end


Anybody know what I did wrong, and how to fix it?

0
*CFrame.Angles(0,math.rad(90),0) greatneil80 2647 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago

You can use something similar to a Model, called a Union. Basically: Highlight all the parts, Right click, then press the button that says union (don't right click if your hovering over the explorer, right click hovering over the parts)

A union, like a model is all the parts. But a union has a orientation property, that you an adjust constantly, including position, size, and a lot of other properties.

0
I like this answer, but sometimes it's not the desired outcome to union all the parts together. Like if I have a spaceship that I need to have rotating but it has moving parts and particle effects in specific part locations. I can't union that together. Roger111 347 — 4y
Ad
Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

If you want to rotate a model the best way is welding every part of the model to the PrimaryPart and rotating the primarypart as any normal part, just make sure the primary part is in the middle for your use case so that i rotates around it self, so every part that is welded must be unachored and the primarypart can be anchored,

what you also might be interesed in is using physics, thats welding everything to a middle part and then using a hinge constraint to rotate the object around itself

like this video of roblox themself

Answer this question