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

Can you do fromEulerAnglesXYZ on a model?

I'm making an elevator game and for one of the floors I want to make a script to spin the elevator and I tried using fromEulerAnglesXYZ but it says Workspace.Elevator.Elevator.SpinScript:2: invalid argument #1 (CFrame expected, got nil), Can anyone help?

Here's my code

while true do
	script.Parent:GetChildren().CFrame = script.Parent:GetChildren().CFrame * CFrame.fromEulerAnglesXYZ(0.0,0.1,0.0)
	wait()
end

1 answer

Getchildren() returns a list of the script.Parent's children, and doesn't have a CFrame. Since you are using a model, you can instead use script.Parent.PrimaryPart.CFrame, but make sure you set the PrimaryPart of the model using the properties window of the model.

2 comments

0

What do I use as a primary part?

0

You can use any part that is part of the model as the primary part.

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