Animate a simple rotation using Code Builder

Last updated: January 20, 2025

Make sure to have claimed a plot, be in 'Create' mode, and press the 'Build' button on the left side of the screen until you see a toolbar appear on the right side of the screen.
  1. Select the item you want to be animated.

  2. On the tools on the right-hand side, select the Code builder. Upon clicking the tool, a 'Properties' tab should open. Click on 'Code Builder' on the Properties tab, and name your script and object.

  1. Select 'Events' on the left side of the builder to indicate when you want the object to start animating. To animate the object from the start of the game, select At start. To have the object animate continuously throughout the game, select 'Control' on the left and insert the do forever block.

  2. Select 'Motion' on the left side of the builder and add the tween rotation block. Make sure to change tween rotation from 'to' to 'by' to indicate the amount you wish to rotate. Write the amount (in degrees) you wish to rotate on the correct axis* and the time taken to rotate the object by that amount (for a slower rotation, input a small number for its rotation and a longer duration of time) .

*Ensure you are rotating the object on the correct axis. You can check which axis the object is rotating on via the rotation tool in the toolbar (eg. rotating the y axis will rotate the object horizontally).

  1. Add a wait - seconds block from Control on the left to ensure the code runs smoothly. The ** wait - seconds ** block adds a small amount of delay before the rotation block runs again, which helps the code run continuously in a specific sequence to avoid overlapping. Make sure to input a small number (Any number below 5 seconds so the object keeps rotating, I used 0.1 in this case) so that the delay would not be noticeable and the animation flows smoothly.

Was this article helpful?

Thanks for your feedback!