Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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)
0
use rotation not rot velocity OBenjOne 190 — 5y
0
“The part only rotates if it is not anchored.” : https://developer.roblox.com/api-reference/property/BasePart/RotVelocity User#20279 0 — 5y

2 answers

Log in to vote
0
Answered by
OBenjOne 190
5 years ago

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.

Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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)

Answer this question