All videos · All how-to videos

How to make an object spin with code in R3

0:44 · 2026-10-19

In the R3 editor: open Create and add a Cube and a Code component. In the Inspector, open the new script (its event, RENDER_BEFORE, runs it every frame), press Edit Code and add one line to update that turns the cube a little every frame. Press Run, then Start Code. Narration: AI voice.

Watch on YouTube

Chapters

  1. 0:00 Create: add a Cube
  2. 0:08 Add a Code component
  3. 0:12 Open the script: RENDER_BEFORE runs it every frame
  4. 0:23 Edit Code: one line in update
  5. 0:32 Run, then Start Code
  6. 0:37 There's your spinning cube

Transcript

0:02 Open the menu, then Create. Search for cube, and add a Cube.

0:08 Then search for code, and add a Code component.

0:12 In the Inspector, open Scripts, then the new script. Its event, RENDER_BEFORE, runs it every frame.

0:23 Press Edit Code. In update, add one line that turns the cube a little every frame.

0:32 Press Run. Close the editor, then start Code, up at the top.

0:37 Hide the panel, and there's your spinning cube.