Customized particles broken since 8.51.2 (all underscore _props moved)

Hi everyone,

This is more like an FYI not a call for a fix.

This is the commit: Moving properties to an extra object to avoid V8 de-optimization (#17… · BabylonJS/Babylon.js@b8bb49d · GitHub If I am reading this right, it was merged in v8.51.2.

Anyway, since then, all customized methods of particle systems that access underscored props like _scaledDirection will crash! While the official Babylon convention is underscored props are considered as private and can change at any time, in this particular case, the offical docs kind of encourage changing private props.
It slipped through in my case. So this post might help save you debugging time :saluting_face:

To fix, use this replace pattern:

// particle._scaledDirection
particle._properties.scaledDirection

Best wishes
Joe

2 Likes

cc @AlitarSemiramis

1 Like

Thanks for reporting this! I am going to update the docs on this matter asap.

1 Like

Update on the docs and PGs is here:

Fixing custom particles docs by VicenteCartas · Pull Request #1575 · BabylonJS/Documentation

Thank you so much for reporting!

1 Like