I’d like to show a simple animation at the point where the user touches the screen on their device. It’s a simple particle emitter based on this project.
My basic approach is to move the folder/group containing the particles to the desired location and then trigger the animation. It works fine when referencing an object’s position like so…
particle_emitter.position( another_object.position() );
particle_code.fireEmitter();
Using using the localPosition or screenPosition property of the pointerdown event, however, results in the animation occurring at the wrong location…
parent.on("pointerdown", (e) => {
particle_emitter.position( e.localPosition );
particle_code.fireEmitter();
});
I’m using a large plane that covers the screen to capture the pointerdown event. Where am I going wrong? Do I need to perform some kind of coordinate conversion?
Any help appreciated.