blob: 9b7d2ad874ad072ea6721c331e67ea72649ea94a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
KX_SCA_AddObjectActuator(SCA_IActuator)
=======================================
base class --- :class:`SCA_IActuator`
.. class:: KX_SCA_AddObjectActuator(SCA_IActuator)
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.
.. code-block:: none
Error: GameObject 'Name' has a AddObjectActuator 'ActuatorName' without object (in 'nonactive' layer)
.. attribute:: object
the object this actuator adds.
:type: :class:`KX_GameObject` or None
.. attribute:: objectLastCreated
the last added object from this actuator (read-only).
:type: :class:`KX_GameObject` or None
.. attribute:: time
the lifetime of added objects, in frames. Set to 0 to disable automatic deletion.
:type: integer
.. attribute:: linearVelocity
the initial linear velocity of added objects.
:type: list [vx, vy, vz]
.. attribute:: angularVelocity
the initial angular velocity of added objects.
:type: list [vx, vy, vz]
.. method:: instantAddObject()
adds the object without needing to calling SCA_PythonController.activate()
.. note:: Use objectLastCreated to get the newly created object.
|