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

Rotating Brick goes to 0,0,0?

Hello! I'm having an issue with a script. When I run the script, the brick teleports to 0,0,0. I'm using CFrame.Angles to practice with every CFrame.

part = script.Parent 
	a = 0
	repeat
	part.CFrame = CFrame.Angles( 0, a, 0) 
	wait(.01) 
	a = a+3 
until unAssigned == 1 

1 answer

This is happening because you are setting the CFrame and not modifying it. CFrame.Angles returns a CFrame object with blank positional data. That's why it's going to 0, 0, 0.

You need to translate the original CFrame by using the * operator, like so:

part.CFrame = part.CFrame * CFrame.Angles(0, a, 0)

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