I was just wounding how would I make liquid fun particles pass through object?. I was wanting to make rain that when hit a physics body it would be destroyed.
Hi @scottrules44,
Can you please post some basic code on how you’re attempting this? Remember to surround the code with “lua” tags for clarity:
[lua] ... [/lua]
Thanks,
Brent
[lua] local testParticleSystem = physics.newParticleSystem( { filename = "partical.png", radius = 3, isSensor= true, imageRadius = 4, x =20, y= 20 } ) camera:add(testParticleSystem, 1) local function onTimer( event ) testParticleSystem:createParticle( { flags = "destructionListener", "water", velocityX = 256, velocityY = 480, isSensor= true, color = { 1, 0, 0.1, 1 }, x = 0, y = 0, lifetime = 32.0 } ) end timer.performWithDelay( 20, onTimer, 0 ) [/lua}
thanks , Scott
Hi @scottrules44,
How important is it for the particles to “pass through” the object(s)? You say that you want to destroy the object when a particle hits it, so can’t you just detect the collision and destroy the object without any pass-through behavior associated?
Brent
That is a good point, I will do that thanks.
Hi @scottrules44,
Can you please post some basic code on how you’re attempting this? Remember to surround the code with “lua” tags for clarity:
[lua] ... [/lua]
Thanks,
Brent
[lua] local testParticleSystem = physics.newParticleSystem( { filename = "partical.png", radius = 3, isSensor= true, imageRadius = 4, x =20, y= 20 } ) camera:add(testParticleSystem, 1) local function onTimer( event ) testParticleSystem:createParticle( { flags = "destructionListener", "water", velocityX = 256, velocityY = 480, isSensor= true, color = { 1, 0, 0.1, 1 }, x = 0, y = 0, lifetime = 32.0 } ) end timer.performWithDelay( 20, onTimer, 0 ) [/lua}
thanks , Scott
Hi @scottrules44,
How important is it for the particles to “pass through” the object(s)? You say that you want to destroy the object when a particle hits it, so can’t you just detect the collision and destroy the object without any pass-through behavior associated?
Brent
That is a good point, I will do that thanks.