Im having trouble when rotating this part, it works fine for the first 3 rotates but when I try to rotate it again it just switches between two vector3 values.
So, the part starts off at (0,0,0) I press "r" once and it goes to (0,90,0) on the second click the rotation is: (-180,-0,-180) on the third click the rotation is: (-0,90,0) on the fourth click the rotation is (180,-0,-180)
and it just keeps doing (180,-0,-180) and (-0,90,0) after that..
Is there a better way to rotate a part using a script??
This is a part of my local script and its for a build preview
mouse.KeyDown:connect(function(key)
for i,child in pairs(HQ:GetChildren()) do
if child:IsA "BasePart" then
key = key:lower()
if key == 'r' then
child.Rotation = child.Rotation + Vector3.new(0,90,0) --Rotate (Works ok for first couple times then theres a problem ....Eventually I need this to repeat so I can keep rotating it until I like where it is)
end
end
end
end)
Thanks for helping!

3 comments
This should be a comment, not an answer.
You need more reputation to comment. Just try not to post answers unless you know the answer, and you can explain it properly.
Sorry, I wont do that again