Skip to content

Scene

Functions

  • CreateEntity(): Create an empty entity with the given name. It has no Transform until you add one
  • FindEntity(): Find an entity by name, or by a path of names through the hierarchy such as "HUD/Score"; check the result with IsSceneValid()
  • FindEntityByID(): Find the entity with the given UUID; check the result with IsSceneValid(), like FindEntity
  • GetPixelsPerUnit(): Get how many texture pixels make one world unit
  • GetPrimaryCamera(): Get the entity whose Camera is marked Primary
  • InstantiateEntity(): Spawn a copy of an entity, children included, at a position, and return the copy
  • InstantiateScene(): Spawn a copy of every entity in a loaded scene (see LoadScene) at a position
  • MultiRayCast2D(): Cast a ray between two world points and return every collider hit, as a table of HitResult2D
  • QueryPoint(): Get every entity whose 2D collider contains a world point, e.g. to pick objects with the mouse
  • RayCast2D(): Cast a ray between two world points and return the first collider hit, as a HitResult2D
  • RemoveEntity(): Destroy an entity and its children; returns false if it isn't in this scene
  • ScreenToWorldPoint(): Convert a screen position, such as Input.GetMousePos(), to world space using the primary camera; optional Z plane, default 0
  • WorldToScreenPoint(): Convert a world position to a screen position using the primary camera