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

Is a rotation brick possible?

Asked by 6 years ago

Alright, so I need help making a brick that, if a part/player goes onto it, it rotates it in the direction I want it to go. I am not a scripter either.. mainly a builder, so thats why I am coming here for some help.

0
Sorry but this isn't a request site, what you need to know is the touched event and CFrames (or Vector3 but you should never use Vector3 rotation) User#20388 0 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

:What you could do (if you want to rotate it smoothly), would be to use a for loop and change the orientation a tiny bit each time. This would be shown below:

local part = script.Parent
for i=1, 90 do
    wait(0.05)
    part.Orientation = part.Orientation + (0, 1, 0)
end

This would make it rotate a tiny bit 90 times, also known as rotating it 90 degrees. You can tinker with the script if you have the experience, just change the 90 in the script to the number of degrees you want to rotate it and change the wait feature if you want it to rotate slower or faster. You can also change the (0, 1, 0) to the amount of degrees you want to rotate it each time in what direction, this script rotates it around its z-axis. Hope this helped!

Ad

Answer this question