ParticleHelper: EmitterNode is undefined


I’ve started ParticleHelper but I have trouble setting the particle position, I have a cylnder and I would like to place the particle effect above it but the set.emitterNode is undefined and it also seems to be a read only property, so I have no way of setting it.
My code is very simple and I do not know why the emitterNode is undefined.
What would cause the emitterNode to be undefined?
Is there a reason why the emitterNode needs to be readonly?

ParticleHelper.CreateAsync("fire", scene).then((set) => {
               set.emitterNode.position = set.emitterNode.position.add(
                        new Vector3(0, h/2, 0)



You want to set the emitter on each system independently though with => s.emitter = foo)

I can also add a setter to the emitterNode if you want :wink:

Thanks I think I understand a little, I was looking at your sun ParticleHelp example.
I guess the sun is just one particle so I can set the emitterNode.position, the fire is many sub-systems so it doesn’t have a single emitterNode

I can also add a setter to the emitterNode if you want

Yeah if you can that would be great - I was trying to create a TransformNode sitting on top of the cylinder where I would like to fire to go.

Will be in next nightly :wink:

1 Like