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

How Do You Prevent a Cylinder Part From Rotating? Help!

I placed this script in the cylinder part:

function onTouched()
	script.Parent.CFrame = CFrame.new(script.Parent.Position.X, script.Parent.Position.Y - 0.2, script.Parent.Position.Z)
end

script.Parent.Touched:connect(onTouched)

When I touch the cylinder part, it's rotation goes from (0, 0, -90) to (0, 0, 0)! How can I prevent this? Thank you!

2 comments

0

This script is not the source of the problem, simply show all the scripts.

0

Yes it is. You missed it.

1 answer

✓ Accepted answer

You are setting its CFrame. The CFrame you are setting it to does not have a rotation. Multiply it by CFrame.Angles(0,0,-math.pi/2) to add the (0,0,-90) rotation.

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