Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change particle mass via script
#4
(24-04-2018, 07:33 PM)leonrdo Wrote: Thanks again Jose

Setting the velocity before the mass did solve my problem, but running in Editor Mode, when I click Edit Particles to check the particle's properties, the mass changes back to default value. Not that this is crucial, once executing the Standalone of my project, the particles remains fixed.

The editor stores per-particle masses (1/inverse mass) to prevent precision loss from switching from mass to inverse mass back and forth, since it must present the user a mass value in the interface and convert whenever there's a change.

This means that if you only update the inverse mass trough code but do not update the editor's mass, it will re-set the particle inverse mass to 1/mass every time you select the particle.

As you discovered, this only happens in the editor and it is not an issue when altering masses at runtime.

cheers!
Reply


Messages In This Thread
Change particle mass via script - by leonrdo - 20-04-2018, 08:15 PM
RE: Change particle mass via script - by leonrdo - 24-04-2018, 07:33 PM
RE: Change particle mass via script - by josemendez - 25-04-2018, 08:16 AM