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

My rotate script is not working when I anchor the block. Whats the problem with it?

Hello! So I am using a rotate block script, and when I click to rotate it unanchored, it works perfectly, but then once I anchor it the script completely breaks and I do not even know why this happens and I was wondering if its a problem with the script. If you could just take a quick look at the script, and see if there is something wrong that would be amazing appreciated!

script.Parent.ClickDetector.MouseClick:connect(function()
print("Rotating")
script.Parent.RotVelocity = Vector3.new(0, script.Parent.RotVelocity.y + 2, 0) --Change this to your desired velocity.
end)

2 comments

0

use rotation not rot velocity

0

“The part only rotates if it is not anchored.” : https://developer.roblox.com/api-reference/property/BasePart/RotVelocity

2 answers

RotVelocity changes the velocity, not the actual rotation when a part is anchored it cannot move, velocity just makes it into a conveyor belt. Using rotation or CFrame would be able to fix this by changing the actual rotation instead of just rotation speed.

just desactive the contraints + Collisions you should be able to move it without unanchor it

Oh and you should have use Orientation

script.Parent.ClickDetector.MouseClick:connect(function()
print("Rotating")
script.Parent.Orientation= Vector3.new(0, script.Parent.Orientation.y + 2, 0) --Change this to your desired velocity.
end)

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