Hello!
I am writing a component for Niantic Studio.
I have a question about the data I can get from the ecs.input.SCREEN_TOUCH_START event.
When I output event.data to console, I get
{pointerId: 1, position: {...} , worldPosition: BN, target: undefined}
is outputted.
Outputting event.data.worldPosition yields
{x: -1.5845162968111624, y: -0.8738807687578227, z: 2.240194782272699}
is now output.
I think this is the location/worldPosition of the entity that was hit by a ray cast-like event during the SCREEN_TOUCH_START event, is this correct?
I am using this (Studio: VPS Procedural | 8th Wall | 8th Wall) as a reference to create a mesh from the bufferGeometry of the event.data obtained from the reality.meshfound event and add it to the scene.
What I want to do is to raycast to this mesh in SCREEN_TOUCH_START.
But currently, it seems that the rays are not hitting this mesh, but are floating a bit or a bit in front of it. And target is always undefined.
Do I have to add the target for SCREEN_TOUCH_START from ecs.createEntity()?
If so, is it possible to set the bufferGeometry to the entity created by ecs.createEntity()?