Search the Community
Showing results for tags 'solidparticlesystem'.
-
Hi, I am trying to set up falling particles and I am using typescript. So far I have been able to create particles but no make them fall. Code to make particles: var myPositionFunction=(particle, i, s)=>{ particle.position.x = (Math.random() - 0.5); particle.position.y = (Math.random() - 0.5); particle.rotation.y = Math.random() * 3.5; particle.position.y += 0.1; particle.checkCollisions = true; this.SPS.updateParticle(particle); }; this.SPS = new BABYLON.SolidParticleSystem("sps",this.scene,{updatable:true}); var model = BABYLON.MeshBuilder.CreateBox("m",{width:0.03,height:0.03,depth:0.03}, this.scene); this.SPS.addShape(model,100,{positionFunction: myPositionFunction}); var mesh = this.SPS.buildMesh(); model.dispose(); this.SPS.updateParticle = function(){ } Whenever I try to make the this.SPS.update function it gives me this error Type '() => void' is not assignable to type '(particle: SolidParticle) => SolidParticle'. [TSC] Type 'void' is not assignable to type 'SolidParticle'. They only way I've been able to get that error to go away is if I put it in the myPositionFunction and put particle as one of its parameters. I also can't find much on using Solid particle systems in typescript at all. Any ideas on how to fix this ?
-
Hello everyone! I am creating an effect use SolidParticleSystem. I calculated direction particle (arrow in PG) move to ahead but it wrong. I created a simple PG: https://www.babylonjs-playground.com/#EP87PX I searched and tried more than 3 hours but i has failed Thanks for everyone!