DocsLearn

Your first graph

You are going to build a snowman, and then you are going to resize it and watch it put itself back together.

That second part is the point. Most tools ask you to drag things into position. Here you describe how parts relate to each other, and the graph works out the positions. Fifteen minutes from now you will have something you can change without repairing.

Stack two snowballs#

Add a Sphere and set its Radius to 0.62. Add a Place On and wire the Sphere into its Part socket. Leave Base empty: an empty Base means "sit on the ground", so the ball drops until it rests on the origin plane.

Add a second Sphere at Radius 0.44 and a second Place On. Wire the new Sphere into Part, and wire the *first* Place On into Base.

Now try this. Change the bottom Sphere's Radius from 0.62 to 0.8.

The middle ball rides up and stays touching. You did not move it. You never told the graph where it goes, only what it sits on, so the graph worked the rest out.

This is the first idea worth keeping: relationships survive edits. The middle ball is not at a height. It is on the body. The body is not at a height. It is on the ground.

Build the head as one piece#

The head needs a face, and this is where it would be easy to go wrong. If you place a nose out in the world at head height, it will sit there while the head moves away underneath it the first time you resize anything.

So build the head where it starts: at the origin, before it goes anywhere.

Add a Sphere at Radius 0.31 and leave it alone. Add a Cone with a Radius of 0.055 and a Height of 0.26 for the nose, and a Transform to put it on the face: Rotation X of 90 to tip it forward, and a small push out in Z. Two more small Spheres, each with their own Transform, become eyes. For the hat, add a Cylinder and seat it with a Place On onto the head Sphere, with a Gap of -0.05 so it settles into the snow instead of balancing on top.

Every number you just typed is small, because every one of them is measured from the head's own centre rather than from the world. That is the difference between an offset and a position.

Wire the head, nose, eyes and hat into a Join Geometry. Think of each branch as one piece you are building: you can shape, position and paint that piece by itself, and Join Geometry is where those separate pieces finally become one result.

Put the head on the snowman#

Join your two seated snowballs with another Join Geometry, then add one more Place On: the head Join into Part, the snowball Join into Base.

The whole head rises onto the stack in one move, and everything you built into it comes along.

This is the division worth remembering. Place On makes the relationship. Transform positions a piece inside the thing you are building. Reach for Place On when one thing sits on another, and Transform when you are arranging parts that will travel together.

Give it colour#

You have three colours and more than three pieces, so group the pieces that share one. Join the eyes and the hat together and give that group a single near black Set Material. Give the nose an orange one, the head Sphere and the snowballs an off white.

Here is the shape of what you have built:

text
Sphere ─ Place On ┐
                  ├─ Join Geometry ─ Set Material (white) ──────┐
Sphere ─ Place On ┘                                             │
                                                                │
Sphere (head) ─ Set Material (white) ───────┐                   │
Cone ─ Transform ─ Set Material (orange) ───┤                   │
Sphere ─ Transform ┐                        ├─ Join Geometry ─ Place On
Sphere ─ Transform ├─ Join Geometry ─ dark ─┘                   │
Cylinder ─ Place On ┘                                           │
                                                                ↓
                                                        Join Geometry

Notice the pattern: join the parts that share a material, paint that group, then join the coloured groups together. A Set Material applies to everything above it in the graph, so one placed after the final Join Geometry would paint the entire snowman a single colour and quietly overwrite every colour you had already chosen.

Turn a number into a knob#

You have been editing the body's Radius by opening the Sphere and typing. That works, but it is not what you would hand to anyone else, and it is not what the demos you opened were doing.

Add a Value node and set it to 0.62. Wire it into the body Sphere's Radius, so the Sphere no longer owns that number. Then expose the Value with the toggle in its header, and give it a name: Body Size.

It appears in the knob panel on the right, alongside the colours you set. That panel is the whole interface to your graph. Anyone opening this file, and any game you export it to, gets that control and nothing else to worry about.

Now break it#

Drag Body Size from one end of its range to the other. Try it very small, then larger than the middle ball.

Everything re-stacks as you drag. The face stays on the face, the hat stays on the head, and nothing detaches, because none of those positions were ever numbers you typed.

You didn't build one snowman. You built a snowman system that can produce many of them, and the knob is how anyone else drives it.

The snowman this lesson builds. Drag Body Size: the stack, the face and the hat all hold together.

Want to keep going#

Add buttons with a couple of small Cubes on the middle ball. Give the hat a brim by joining a wide flat Cylinder under it. Try arms, or a scarf.

One knob is a start, and it only drives the body. Everything else is still a number: the middle ball, the head, the size of the face. Making every proportion follow that one control is exactly what you will do two lessons from now, when you come back to this snowman and finish the job.

Open the editor and try it