logo
By Lawrence

5 minutes

A Plant That Takes Them

The rocks bend past the hole and fly off the top of the field. Nothing is there to receive them.

A sphere, and a tag

A capture zone is a sphere test: a point p is inside when |p − c| ≤ r. Our plant sits at [27, 0, 7] with a radius of 2.5:

rock at [24.6, 0, 7]      2.4 from the centre     inside: taken
rock at [24.4, 0, 7]      2.6 from the centre     outside

Which bodies count is decided by a tag, not by a component. The zone takes anything tagged rock, a GravityBody rock or a physics ball alike.

Continue reading

Unlock the Full Course

Every lesson, the runnable examples, and the finished build — yours to keep.

$9one-time

Was this page helpful?

We read every note — tell us what's working and what isn't.

↑↓ NavigateEnter SelectEsc CloseCtrl+K Open Search