useBodyMeshes — if you need more control over how meshes are styled, use useBodyMeshes directly.
Signature
Usage
Composing with Other Logic
The hook is useful when you want to combine highlighting with other behavior in a single component:Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
bodyId | number | null | — | ID of the body to highlight. Pass null to clear. |
options.color | string | '#ff4444' | Emissive highlight color. |
options.emissiveIntensity | number | 0.3 | Intensity of the emissive glow. |
How It Works
- Uses
useBodyMeshesto get the meshes for the given body ID - Sets the mesh material’s
emissivecolor andemissiveIntensity - Restores original emissive values when
bodyIdchanges or the component unmounts
Related
useBodyMeshes— the low-level primitive this hook is built on, for custom visuals and postprocessing