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

Part Rotations causing the part to flip between 90, 0, 0 and 80, 0, 0. Help?

Asked by 5 years ago

The script below has a problem. The part gets to 90, 0, 0 then starts rapidly switching between 90, 0, 0 and 80, 0, 0. How can I fix this?

while wait() do
    script.Parent.Orientation = script.Parent.Orientation + Vector3.new(10, 0, 0)
end
1
Try CFrame User#22219 20 — 5y
0
Ok AlphaGamer150 101 — 5y
1
Is it colliding with any other parts? I think you should rotate it using the parts CFrame instead. Impacthills 223 — 5y
0
I don't know what I would do with out this site. AlphaGamer150 101 — 5y

2 answers

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago
script.Parent.CFrame = script.Parent.CFrame * CFrame.fromEulerAngles(math.rad(10),0,0)

http://robloxdev.com/articles/Euler-Angles

Ad
Log in to vote
0
Answered by 5 years ago

Thanks to ud2v3cf I was able to come up with this working solution:

while wait() do
    script.Parent.CFrame = script.Parent.CFrame * CFrame.Angles(math.rad(10), 0, 0)
end

Answer this question