OXY11 Posted May 25, 2016 Share Posted May 25, 2016 I have a SPS and when I hit a particle with mouse I clone a mesh "imgThumb", and I give her the ID using particle idx: var newThumb = imgThumb.clone("thumb"); newThumb.id = particle.idx; but I'm not able to dispose this mesh, this doesn't work: var deleteThumb = function (particle) { getMeshById(particle.idx).dispose(); } Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 25, 2016 Share Posted May 25, 2016 Hiya Oxy11, and welcome. I see a few issues. getMeshById(particle.idx) is unlikely to work correctly. For clicked particle, scene.getMeshById("id") is not the same as SPS.particles[idx]. Maybe try SPS.particles[idx].dispose(); ?? Would you be willing to modify (and make some more SAVES-of) this playground demo to reproduce the issue? It is easier for everyone to work-on... when there is a playground demo. thx! GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted May 26, 2016 Share Posted May 26, 2016 you can't dispose a particle within the SPS as each particle is just a subpart of the whole SPS mesh particle.idx, if you really get it correctly from the mouse picking (dev console will help, PG as well), is an integer Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.