Camera
Inherits: Instance
Camera is an instance that represents a camera in the game world.
Properties
The camera's coordinate matrix. Only editable when CameraMode is Scriptable.
The CameraMode of the camera.
The offset applied to the camera follow target, in studs.
The speed at which the camera moves when in Fly mode.
The distance the camera attempts to maintain from its follow target when in applicable modes.
The offset applied to the camera follow target, in studs.
The target Instance that the camera follows in applicable modes.
The field of view (FOV) of the camera in degrees.
The maximum distance the camera can be from its follow target.
The minimum distance the camera can be from its follow target.
Whether first-person controls are allowed when the camera is in Orbit mode and fully zoomed in.
The position of the camera.
The rotation of the camera.
Functions
Adjusts the camera's position to fit the given bounds within the viewport, taking into consideration the viewport aspect ratio and the camera's FOV.
- bounds
- The bounds to fit within the camera's view.
- padding
- Optional padding to apply around the bounds, in studs. Default is 0, meaning the bounds will fit exactly within the view.
Properties
Whether this Instance or any of its descendants should be included when saving or copying via Clone()
The unique identifier for this Instance.
If true, this instance and all of its descendants cannot be selected in the editor.
The name of this Instance.
The parent of this Instance in the hierarchy.
The sort index of this Instance among its siblings. If this Instance has no parent, this value is ignored.
Functions
Attaches a script to this instance by its file path. The path should be relative to the root assets directory, e.g. "Scripts/MyScript".
Creates a deep clone of this Instance and all its descendants.
Removes this Instance, and all its descendants, from the DataModel, and locks its parent property.
Schedules this Instance to be destroyed after the specified delay in seconds. This function will error if called multiple times.
Removes a script from this instance by its file path. The path should be relative to the root assets directory, e.g. "Scripts/MyScript".
Returns an array of the children of this Instance.
Gets the global bounding box that encapsulates all DynamicInstance children of this Instance.
Returns the path of the script component at , or an empty string if the script file no longer exists.
Determines if this Instance is a descendant of the specified ancestor Instance.