EntityProps
EntityProps =
object&BodyDeclaration
What an Entity takes: its own props, and its body and collider.
Without a collider the entity has no body: a character’s is its own,
and a coin without one is walked through. A collider with no body is a
fixed body; a change to either after spawn edits the body in place.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
ai? |
AiMetadata |
What it is and what can be done with it, in words, over what its behaviours say: its node in the AI tree. |
animation? |
string |
The name of the model file’s clip to loop, such as walk. A name the file lacks plays nothing, and a dev world warns once with the names it has. |
animationOffset? |
number |
Where in its loop animation starts, as a share of the clip’s length: 0 its start, 0.5 halfway, wrapping past 1. Read as the loop starts, so a new value waits for the next animation. Copies of one model given different offsets do not move in step, as Unity’s Cycle Offset keeps a herd apart. |
authority? |
AuthorityContext |
- |
farDistance? |
number |
The distance past which a page receives its pose at farSendsPerSecond, in metres, over the prefab’s. A change after spawn applies at once. |
farSendsPerSecond? |
number |
How many times a second a room sends its pose to a page past farDistance, over the prefab’s: see the prefab’s farSendsPerSecond. A change after spawn applies at once. |
material? |
ModelMaterial |
What its model wears in place of each of the file’s materials, handed the one the file gave the mesh, such as a dissolve over the file’s texture: the material the model registered with when left out. The engine asks the function once for each of the file’s materials and keeps what it returns, so every Entity handed the same function wears the same materials, and the animated ones draw together in one draw per mesh; a second function draws in a batch of its own. Define it once, outside the component: a function made anew each render makes new materials each render. The material it returns is the game’s to dispose. |
membersOnly? |
boolean |
Whether it touches only its own match: its members’ characters, the match’s own entities and the scenery, so a court’s net stays solid for its players while a passer-by walks through it, and a passer-by’s ray, interact and camera pass it. It passes characters and moving bodies outside its match, and other matches’ membersOnly entities. A change after spawn applies at once. One with no match above it, under a <Match> or by owner, throws in development. As Roblox’s CollisionGroup keeps a part to a group, here by match. |
model? |
string |
The name of a registered model, or a path the game serves such as assets/statue.glb, read from the page’s own folder, drawn inside the entity’s group. |
movementMode? |
NpcMovementMode | "nav-walking" | "walking" |
How it moves while it needs no physics, over the prefab’s: see the prefab’s movementMode. |
name? |
string |
The entity’s row name in the devtools tree; the component’s own when left out. |
position? |
Position |
Where it stands, [x, y, z] in metres. |
positionPrecision? |
number |
The step its position is rounded to as it is sent, in metres, over the prefab’s. A change after spawn applies at once. |
prefab? |
Prefab |
The kind of entity it is, as definePrefab declared it: its traits, model, body and collider, which a system’s spawn of the same prefab gives too. The Entity’s own model, animation, body and collider go over the prefab’s, and its pose is the Entity’s. |
relevance? |
Relevance |
How far it reaches the pages of a room that culls by interest, over the prefab’s: Relevance.Always keeps it on every page that may see it, whatever the distance. A change after spawn applies at once. |
rotation? |
RotationInput |
How the entity is turned: three Euler angles in radians, in three.js’s default order, as React Three Fiber’s rotation prop takes them, or a quaternion. Its collider turns with it. |
scale? |
ScaleInput |
How large the entity is: one number for every axis, three, or a vector. Its collider and its model scale with it; a sphere takes one number for every axis and a capsule the same across x and z. |
sendsPerSecond? |
number |
How many times a second a room sends its changes, over the prefab’s: see the prefab’s sendsPerSecond. A change after spawn applies at once. |
static? |
boolean |
Whether its model stands still, so the sun’s far shadow map draws it once and keeps it past the cascades. Turn it off for a model the game moves; turn it on for one with no body that never moves. Left out, an entity whose body is fixed, a collider with no body among them, stands still, and every other moves. Unity’s word for a GameObject that never moves. |
traits? |
readonly ConfigurableTrait[] |
Traits of its own over its prefab’s, field by field, as a spawn’s traits are: what differs from one placement of a prefab to the next, such as a lantern’s colour, traits={[LanternTrait({ color: "red" })]}. A field whose value changes after spawn is set again, and a field a system wrote meanwhile keeps its value while its prop stays. Which traits it lists is fixed at spawn: a new key spawns the Entity again with another list. A trait a behaviour child sets goes through that behaviour alone. On a page in a room the room’s entity holds them, and its stream brings each defineTrait one. |
unseen? |
Unseen |
What it does while no page wants it, over the prefab’s, for a character no player controls: see the prefab’s unseen. A change after spawn applies at once. |
view? |
false | EntityView |
How it is drawn on a page, in place of its model: a component handed the entity, drawn where it stands, or false to draw no body. Its prefab’s view when left out, and its model, or the loot gem, when neither names one. A room never mounts it, and its children are logic, which every page and the room run. Define the view once, outside the component: a view made anew each render draws anew each render. A behaviour’s own prompt or sound is not the body and stays with false. |