Abstract
This creates a new Object3D object.
Abstract
activeif the object is enabled in the hierarchy (usually equivalent to visible
)
the object's unique identifier
Abstract
transformNOTE: this is just a wrapper for devs coming from Unity. Please use this.gameObject instead. In Needle Engine this.gameObject is the same as this.gameObject.transform. See the tutorial link below for more information
Abstract
worldAbstract
worldAbstract
worldGet or set the world quaternion of the Object3D.
Added by Needle Engine.
Get or set the world quaternion of the Object3D.
Added by Needle Engine.
Abstract
worldAbstract
worldAbstract
worldAbstract
worldAbstract
addAbstract
addAbstract
destroyAbstract
getAbstract
getAbstract
getAbstract
getAbstract
getAbstract
getAbstract
getGet or add a Needle Engine component to the Object3D. If the component already exists, it will be returned. Otherwise, a new component will be added.
The component constructor to get or add.
The component instance.
Abstract
removeRemove a Needle Engine component from the Object3D.
Static
addStatic
addAdd a new component (or move an existing component) to the provided object
object to add the component to
if an instance is provided it will be moved to the new object, if a type is provided a new instance will be created and moved to the new object
Optional
init: Partial<NoInternalNeedleEngineState<FilterStartingWith<FilterTypes<T, undefined | null | Function>, "_">>>optional init object to initialize the component with
Optional
opts: { Static
addStatic
destroyStatic
destroyStatic
findStatic
findStatic
findStatic
foreachRun a callback for all components of the provided type on the provided object and its children (if recursive is true)
object to run the method on
callback to run on each component, "return undefined;" to continue and "return
if true, the method will be run on all children as well
the last return value of the callback
Static
getStatic
getGets a component on the provided object
Static
getStatic
getStatic
getStatic
getStatic
getStatic
getStatic
instantiateCreates a new instance of the provided object (like cloning it including all components and children)
object to instantiate
options for the instantiation (e.g. with what parent, position, etc.)
Static
instantiateCreates a new instance of the provided object. The new instance will be created on all connected clients
object to instantiate
options for the instantiation
Static
invokeInvokes a method on all components that have a method matching the provided name
object to invoke the method on all components
name of the method to invoke
Rest
...args: anyStatic
invokeInvokes a method on all components including children (if a method with that name exists)
Rest
...args: anyStatic
isIf the object is active in the hierarchy (e.g. if any parent is invisible or not in the scene it will be false)
object to check
Static
isIf the object is active (same as go.visible)
Static
isStatic
isStatic
iterateStatic
markStatic
moveMoves a component to a new object
component to move the component to
component to move to the GO
Static
removeRemoves the object from its parent and deactivates all of its components
Static
removeRemoves a component from its object
component to remove
Static
set
All {@type Object3D} types that are loaded in Needle Engine do automatically receive the GameObject extensions like
addComponent
etc.Many of the GameObject methods can be imported directly via
@needle-tools/engine
as well: