engine icon indicating copy to clipboard operation
engine copied to clipboard

ParticleRenderer's VelocityOverLifetime velocityX velocityY velocityZ's TwoConstants Mode won't work

Open JujieX opened this issue 1 year ago • 0 comments

Describe the bug ParticleRenderer's VelocityOverLifetime velocityX velocityY velocityZ's TwoConstants Mode won't work. Its performance is the same with Constant Mode, which is not as expected. To Reproduce Steps to reproduce the behavior:

      const particleRenderer = particleEntity.addComponent(ParticleRenderer);
      const material = new ParticleMaterial(engine);
      material.baseColor = new Color(1.0, 1.0, 1.0, 1.0);
      material.blendMode = BlendMode.Additive;
      particleRenderer.setMaterial(material);

      particleRenderer.generator.main.startSpeed.constant = 0;
      particleRenderer.generator.velocityOverLifetime.enabled = true;
      particleRenderer.generator.velocityOverLifetime.velocityZ.mode =
        ParticleCurveMode.TwoConstants;
      particleRenderer.generator.velocityOverLifetime.velocityZ.constantMax = 10;
      particleRenderer.generator.velocityOverLifetime.velocityZ.constantMin =
        -10;

Expected behavior direction and speed should varies between constantMin and constantMax

Screenshots image

JujieX avatar Jan 11 '24 08:01 JujieX