Namespace: dmGameSystem
Language: C++
Type: Defold C++
File: comp_factory.h
Source: engine/gamesys/src/dmsdk/gamesys/components/comp_factory.h
Include: dmsdk/gamesys/components/comp_factory.h
API for spawning gameobject instances from a factory component.
Type: FUNCTION Spawns a new gameobject instance in a collection using a factory component.
Parameters
world (HFactoryWorld) - Factory worldcomponent (HFactoryComponent) - Factory componentcollection (HCollection) - Gameobject collection to spawn intoid (dmhash_t) - Identifier for the new instance. Must be unique within the collection. Pass 0 to automatically generate a unique identifier (e.g. /instance1, /instance2 etc.).position (dmVMath::Point3) - Position of the spawned objectrotation (dmVMath::Quat) - Rotation of the spawned objectscale (dmVMath::Vector3) - Scale of the spawned objectproperties (dmGameObject::HPropertyContainer) - Property container with override propertiesout_instance (dmGameObject::HInstance) - Output parameter for the new instanceReturns
result (dmGameObject::Result) - Result of the operation