World size

Why does world size matter?

Positions and livequeries in the world are compressed, and the compression is defined by maximum scale and bit count. Larger scale at the same bit count means lower precision, and vice-versa.

Defining world size

A default maximum world size of 2400 means that only values from [-2400, 2400] will be supported for all spatial axes.

If our game scenes are larger than 2400 x 2 (4800) units across, we can increase this value in the Settings window or in the schema as illustrated below.

Don't forget to extend the LiveQuery scale to match the world position scale.

# Default world positions:

component WorldPosition
  value Vector3 [bits "24", scale "5000"]
  

# LiveQuery:

component WorldPositionQuery
  position Vector3 [bits "24", scale "5000"]
  radius Float [bits "24", scale "5000"]

Last updated