Module KX_SCA_AddObjectActuator :: Class KX_SCA_AddObjectActuator

Class KX_SCA_AddObjectActuator

SCA_ILogicBrick.SCA_ILogicBrick --+    
                                  |    
        SCA_IActuator.SCA_IActuator --+
                                      |
                                     KX_SCA_AddObjectActuator

Edit Object Actuator (in Add Object Mode)


Warning: An Add Object actuator will be ignored if at game start, the linked object doesn't exist (or is empty) or the linked object is in an active layer.

This will genereate a warning in the console:

ERROR: GameObject OBName has a AddObjectActuator ActuatorName without object (in 'nonactive' layer)

Instance Methods
 
setObject(object)
DEPRECATED: use the object property Sets the game object to add.
string, KX_GameObject or None if no object is set
getObject(name_only=0)
DEPRECATED: use the object property Returns the name of the game object to be added.
 
setTime(time)
DEPRECATED: use the time property Sets the lifetime of added objects, in frames.
integer
getTime()
DEPRECATED: use the time property Returns the lifetime of the added object, in frames.
 
setLinearVelocity(vx, vy, vz)
DEPRECATED: use the linearVelocity property Sets the initial linear velocity of added objects.
list [vx, vy, vz]
getLinearVelocity()
DEPRECATED: use the linearVelocity property Returns the initial linear velocity of added objects.
 
setAngularVelocity(vx, vy, vz)
DEPRECATED: use the angularVelocity property Sets the initial angular velocity of added objects.
list [vx, vy, vz]
getAngularVelocity()
DEPRECATED: use the angularVelocity property Returns the initial angular velocity of added objects.
KX_GameObject
getLastCreatedObject()
DEPRECATED: use the objectLastCreated property Returns the last object created by this actuator.
None
instantAddObject()
Returns the last object created by this actuator.
integer
getExecutePriority()
Gets the execution priority of this logic brick. (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
KX_GameObject
getOwner()
Gets the game object associated with this logic brick. (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
 
setExecutePriority(priority)
Sets the priority of this logic brick. (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
Instance Variables
list [vx, vy, vz] angularVelocity
the initial angular velocity of added objects.
int executePriority
This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first). (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
list [vx, vy, vz] linearVelocity
the initial linear velocity of added objects.
KX_GameObject or None object
the object this actuator adds.
KX_GameObject or None objectLastCreated
the last added object from this actuator (read only).
KX_GameObject or None in exceptional cases. owner
The game object this logic brick is attached to (read only). (Inherited from SCA_ILogicBrick.SCA_ILogicBrick)
integer time
the lifetime of added objects, in frames.
Method Details

setObject(object)

 

DEPRECATED: use the object property Sets the game object to add.

A copy of the object will be added to the scene when the actuator is activated.

If the object does not exist, this function is ignored.

object can either be a KX_GameObject or the name of an object or None.

Parameters:

getObject(name_only=0)

 

DEPRECATED: use the object property Returns the name of the game object to be added.

Returns None if no game object has been assigned to be added.

Parameters:
  • name_only (bool) - optional argument, when 0 return a KX_GameObject
Returns: string, KX_GameObject or None if no object is set

setTime(time)

 

DEPRECATED: use the time property Sets the lifetime of added objects, in frames.

If time == 0, the object will last forever.

Parameters:
  • time (integer) - The minimum value for time is 0.

setLinearVelocity(vx, vy, vz)

 

DEPRECATED: use the linearVelocity property Sets the initial linear velocity of added objects.

Parameters:
  • vx (float) - the x component of the initial linear velocity.
  • vy (float) - the y component of the initial linear velocity.
  • vz (float) - the z component of the initial linear velocity.

setAngularVelocity(vx, vy, vz)

 

DEPRECATED: use the angularVelocity property Sets the initial angular velocity of added objects.

Parameters:
  • vx (float) - the x component of the initial angular velocity.
  • vy (float) - the y component of the initial angular velocity.
  • vz (float) - the z component of the initial angular velocity.

getLastCreatedObject()

 

DEPRECATED: use the objectLastCreated property Returns the last object created by this actuator.

Returns: KX_GameObject
A KX_GameObject or None if no object has been created.

instantAddObject()

 

Returns the last object created by this actuator. The object can then be accessed from objectLastCreated.

Returns: None