Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bge.types.KX_SCA_AddObjectActuator.rst « bge_types « rst « python_api « doc - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fecc863909dde29b572bac2b35daf96e1261a6dd (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
53
54
55
KX_SCA_AddObjectActuator(SCA_IActuator)
=======================================

.. module:: bge.types

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.