I am trying to create a particle system and have the following code to add 100 copies of an object…
from bge import logic
import math
import random
particle_list = []
def spawner():
scene = logic.getCurrentScene()
cont = logic.getCurrentController()
object = cont.owner
global particle_list
for n in range(0,100,1):
x = random.uniform(-20,20)
y = random.uniform(-20,20)
z = random.uniform(0,20)
object.worldPosition = [x,y,z]
particle_list.append(scene.addObject("Icosphere",object,0))
It works correctly but I now have a list with 100 identical names! From reading the forums I know that an object name is read only so what work arounds are there to be able to control the individual particles?
Thank you,
Andrew