Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commit65083fe8f2

README.md

OcclusionProxy

A coarse stand-in for an entity's bulk, so it darkens the ground under and around itself.

local id = entity.spawn("boulder").id
entity(id).component.add("OcclusionProxy", {
    radius = 2.0,
    height = 3.0,   -- 0 gives a sphere
})

Put it on a character and the character grounds itself; put it on a boulder and the boulder shades the dirt beside it — without a shadow view, and at any distance. A subject well past the sun's shadow range still gets this, which is the difference between standing on a surface and floating over it.

The proxy follows its entity every frame, so a moving subject keeps its grounding with no popping.

Every field is live: edit one in the inspector and the proxy follows. A radius of 0 removes it without losing the rest of the settings.

The capsule's axis runs along world up. A capsule that tilted with its entity would need the entity's rotation resolved every frame for a shape whose whole job is to be approximate.

For code placing proxies directly, reach for @builtin::systems.proxyOcclusion.proxyOcclusion — same shapes, no component.

The full description is in the package readme: guides { path = "systems/proxyOcclusion" }.