Hi all,
I’ve created a particle system entity that I clone on an event, enable it, position it and then play it. This works fine apart from the positioning - it stays where the original entity was.
BulletScript.prototype.onCollisionEnter = function(event) {
if(event.other.rigidbody === this.target.rigidbody) {
event.other.health--;
if(event.other.health <= 0) {
var effect = this.explosionEffect.clone();
effect.enabled = true;
effect.setPosition(event.other.getPosition());
effect.children[0].particlesystem.play();
this.scoreCounter.element.text = parseInt(this.scoreCounter.element.text) + 10;
event.other.destroy();
}
}
this.entity.destroy();
};
That’s what my code looks like. I tried setting the position manually to (10, 0, 0) however the same issue happens. I also tried enclosing the particle system in a parent entity and positioning that to no luck. What gives?