Particle Clone method is not working locally(on PG it works)

Hey guys,

I faced with a strange issue. When i try to clone particle system it throws error ERROR TypeError: Cannot read properties of null (reading ‘position’)

I have found that it because babylon tries to serialize emitter but my emitter is null at that moment so there is an error. But when i tried to reproduce it on PG i found that particle system have emitter. The same particle system with the same code have different behaviour locally and on PG. I wonder is there some property maybe which i didn’t enable and it is enabled by default on pg?

Working PG. look at 26-30 lines they don’t work locally

I use 8.53.0 version locally because 8.53.1 completely broken

Could you please help?

OMG i found out that if i remove 21 24 lines on PG (creation of sphere) emitter become null.

babylon automatically assign emitter if scene have suitable or what?

looks like i need to assign fake emitter and then clone particle system…

That’s because the emitter is serialized as a mesh id:

During parsing, a mesh with this identifier is searched for in the scene, and if none is found, the emitter remains null in the particle system.

ok then why babylon is trying to clone emitter if it’s null

The code assumed that the emitter mesh would always be found.

This PR will assign a default (0,0,0) position when the mesh is not found during parsing:

3 Likes