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

How to spin models like a ufo rotation?

I did everything from rotating models tutorial in Youtube but it doens't spin as i like and as a UFO rotate.

Model i want to make rotate like a UFO: https://i.imgur.com/A2ZaVjj.png

Sorry for my bad english, i am brazilian and i'm pretty new at scripting

2 comments

0

You'll have to show us your script first. We can't magically see your script.

0

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

2 answers

Do this:

local model = workspace.UFO --The UFO

while true do wait()
	model:SetPrimaryPartCFrame(model:GetPrimaryPartCFrame() * CFrame.Angles(0, math.rad(1), 0)) -- This rotates the model 1 degree
end

Make sure that you have set the PrimaryPart property of the model to a part that is exactly in the middle of your UFO

1 comment

0

Fixed!!!! ik what was the error, was the primary part that was rotating it like a possesed thing, i set the primary part in a normal block THX now it is spinning like a "real" ufo

The most efficient way (as far as I know) to rotate a model is by using the "SetPrimaryPartCFrame" function. It takes a model and rotates it around its PrimaryPart, but take note that you must set that before you use it, or else you will encounter an error. As an example, this rotates the model 90 degrees along its Y axis:

local model = workspace.yourModel

model:SetPrimaryPartCFrame(CFrame.new(0, math.deg(90), 0))

1 comment

0

I set the primary part already and i tried it, but it when i pressed "Run" in the studio it "jumped" to the sky and it didnt moved

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