Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

useInspect

useInspect(name, read, entity?): void

Exposes a view’s own state to the tools, such as the pose a view chose or a strength it keeps in a ref: spawnite play dump prints what read returns under the entity the view draws, and spawnite play eval reads it as views. entity is the one the view draws, the nearest Entity’s where left out, or the page’s with none. read runs only when a tool asks, so it may read what a frame wrote.

Parameter Type
name string
read () => unknown
entity? Entity | null

void