Hello blender heads. Here’s my problem today: in my game, I have to spawn various objects from various points, actually, the objects are planets and the spawning points are the orbital places for them. The thing is that I need the planet to stay parented to the spawner for it has the gravitational animation. if it was just one planet, I would have placed the object as a child of the spawner, but there are hundreds of them and 10 spawners, so I really don’t see any simple way of doing it besides a complex logic bricks setup.
I need the spawner to make the particles it’s own children, I believe only python can do that.
Thanks for you help!
with python, this should not be a problem. Without, you will have a complicated non dynamic system.
Try to spawn the object at the Position of your spawner, then parent it to the spawner and set its position.
So the spawner can do all logic, and the Planets are just parented…
I could do a simple script, but need to have a blend for that, otherwise its pointless.
Well thank you for your replying, I’ll patch up a quick blend representing my problem!
[a few moments later…]
Here’s a simplified version of the stellar system planetSpawner
Thanks a lot!
Errr…, anyone?
i looked at the file, but d’ont get what exactly you want!
Is the idea to spawn the objects at the Empty’s Place and then they shoud be parentet to the empy so it can turn around it?
These gruop of Planets thne shoud turn around the ‘Sun’ in the middle?
Like a fake Solar System?
Please try to explain a little more about the Plan
I haven’t looked in your file but if you spawn with python you can parent it immediatly:
import GameLogic
def addAndParent(cont):
# AND controller logic
for sens in cont.sensors:
if not sens.positive:
return
emitter = ... # e.g. cont.owner
master = ... # e.g. GameLogic.getCurrentScene().objectsInactive["OBWhateverNameItHas"]
scene = GameLogic.getCurrentScene()
newObject = scene.addObject(master, emitter)
newObject.setParent(emitter)
Thank you very much Monster Sensei. Can’t I use a proximity and property setup isntead? Like if new object has propety= planet, or building then parent to emitter. This way I wont have to make a giant list of planets as master, otherwise, I’d use a logic brick per planet to parent to one of the 9 emitters.
@ sevi_ : The planets must be parented to the emitter as soon as they are spawned. The emitters are orbiting around the star, in the blend, that does not happen!
Thank you, gentlemen, for your support!