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

How to make a block do endless rotation?

Asked by 5 years ago

So i am trying to make a certain block rotate clockwise. Online i have found many scripts which do it except it uses the centre of the object as point of rotation. The rotation i am looking for is like a hand on the clock rotation.

P.s I understand a bit of c++ but completely new to Lua so the scripts i have found i don't necessarily understand them so if possible can anyone explain the solution to me as well, thank you.

0
Don't really have time to write out a whole script, so here's some brain food. Imagine something in the center of the clock, rotating. A hand of the clock is attached to it so that when the centerpiece rotates, the hand rotates just the way you want it to. Start with a base CFrame, rotate it, and then apply a translational CFrame. ScrewDeath 153 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

Use CFrame.Angles. Here are some links to help you out.

0
The code from the forums say (Part.CFrame). I have two questions about this line of code. Firstly does the Part refer to the object name so if i named a block Obstacle would you replace the line of code with Obstacle. Gamerzhi 4 — 5y
0
Secondly in c++ there is this variant called (.gameObject) which refers to the entity it is attached to. I was wondering if there is a Lua equivalent. Also sorry about my grammar, im not the best :( Gamerzhi 4 — 5y
0
yes, with Part it's just an example name so you change it. secondly, you can use script.Parent to refer to the object the script is inside of mrspirit9 68 — 5y
Ad

Answer this question