mxs
(mxs)
January 6, 2020, 6:40pm
1
I would only like to use python to control the movement of an added object to the stage. I have this script:
import bge
def main():
cont = bge.logic.getCurrentController()
own = cont.owner
scene = bge.logic.getCurrentScene()
new = scene.addObject("particle", "Empty.001", 0)
new.applyMovement([0,0,1], True)
main()
But object only moves by one unit and there is no motion continuation. I want to make a simple particle emitter
Cotaks
(- Click for (UP)Bge resources)
January 6, 2020, 7:08pm
2
you need to add the movement every tic, so with always true, or on the particle add bricks to move it.
mxs
(mxs)
January 6, 2020, 7:16pm
3
Every tic is set. I would like to specify the behavior of the particle in one script to make it universal
Even if the particle-objects where constantly moving, they’d all be moving in the same direction unless you also defined different (random) rotations for each object.
cont.owner.applyRotation()
Cotaks
(- Click for (UP)Bge resources)
January 6, 2020, 8:00pm
5
add object on the empty
python on the particle
– now you can script it the way you want
or you need to put the added objects into a list, and loop over that to add speed, etc.
1 Like
mxs
(mxs)
January 6, 2020, 8:17pm
6
No logic brick. I want to create an upbge component. Only python
Cotaks
(- Click for (UP)Bge resources)
January 6, 2020, 10:48pm
7
2 functions,
-1 to spawn object, empty connected to the function
-1 to add speed. etc. to partical. partical connected to this function