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

How to make a block do endless rotation?

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.

1 comment

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.

1 answer

✓ Accepted answer

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

3 comments

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.

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 :(

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

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