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

The part I put this in, goes up when I touch it?

The part I put this in, goes up when I touch it. It's supposed to rotate the part, and it does that fine, but for some reason when ever I touch it the part moves upwards. I want it to stay in place and rotate. Here's my code:

part = script.Parent
 repeat
 part.Rotation = Vector3.new( 0, a, 0)
 wait(.03)
 a = a+3
 until pigsfly == 1

Thanks!

3 comments

0

Keep in mind I'm a new scripter so it may be blatantly obvious.

0

"use"

2 answers

part = script.Parent
partPos = part.CFrame
 repeat
part.Rotation = Vector3.new( 0, a, 0)
part.CFrame = CFrame.new(partPos)
 wait(.03)
 a = a+3
 until pigsfly == 1

I am currently in school and cannot reference CFrame.Angles. If this does not work, comment please.

When Rotate is changed, it checks for collisions with other parts, and teleports the part upwards until it no longer finds collisions. CFrame does not do this, so use CFrame.

part = script.Parent
 repeat
 part.CFrame = part.CFrame*CFrame.Angles(0,math.rad(3),0)
 wait(.03)
 until pigsfly == 1

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