A bike that rolls while its wheels turn
Two levels of movement: the bike's position (parent) and each wheel's rotation (child). The console shows the world position after each parent change.
Objects form a tree: a parent carries its children. Move, turn or scale the bike and the wheels follow, while each wheel still spins on its own. You learn how local and world positions relate and how to print the tree.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Build a crank group that holds two pedals 0.17 m on each side of its centre and turns once every 2 seconds.
Print how many objects are below bike in a scene where the bike has two wheels with two meshes each.
Explain it without notes
A wheel is a child of the bike. The bike moves 1 m forward. What are the wheel's local and world positions before and after?
Why does a child turn around its parent's origin and not its own centre? How do you make a part spin about its own centre?
Console
Nothing logged yet.Expected console output
start | front wheel local x: 0.58 | world: 0.58, 0.35, 0
bike moved +1 | front wheel local x: 0.58 | world: 1.58, 0.35, 0
bike scaled x2 | front wheel local x: 0.58 | world: 2.16, 0.7, 0