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

How can I keep a brick constantly rotated in a for loop?

I'll set the rotation by using

p.CFrame = player.Character.Torso.CFrame *CFrame.Angles(90, 0, 90)

p being the part.

Then when I use the for loop, it will lose rotation when I add this part:

p.CFrame = player.Character.Torso.CFrame *CFrame.new(0, 0, 0)

But I need to add that in or the brick will go above the character

How can I get the brick to stay at it's rotation?

When I add *CFrame.Angles(90, 0, 90) it won't go directly at a 90 degree angle. It needs to be flat, and there's a mesh in it that by default is vertical, so that's why I need to have it rotated, but it never stays rotated.

1 answer

A for loop is not very useful for keeping an object constantly spinning.

If you want this object to keep spinning until a condition occurs, use:

repeat
	--Whatever you want to repeat
until --Condition

If you want this object to keep spinning forever, use:

while true do
	--Whatever you want to repeat
end

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