onPointerObservable on Mesh after start animation

Hello!
When I click on the card, I get pickedMesh (from onPointerObservable or by scene.pick) of my card (id === ‘card_back’). But after animationGroups[0].start the card has another position and when I click on top of the card, I get pickedMesh of the ground.

How can I know that I click on the card?

Hey!

That’s because your mesh is still on the floor and it doesn’t change it’s shape:

You can use GPU picking which picks from the actual pixels on the screen:

Docs:
https://doc.babylonjs.com/features/featuresDeepDive/mesh/interactions/picking_collisions/#gpu-picking

1 Like

I noticed, that I get cardMesh after starting animation, if I click on the initial positions.
Is there a solution to fix this? Get real position or set real position for pickInfo…

I am afraid I don’t understand what’s the question.

I posted a solution with a playground, didn”t it help you?

1 Like

sorry! I didn`t check clearly. It is really that I wanted.

2 Likes

I’m glad iit solved your problem. Would you please mark it as a siolution? Thanks!

2 Likes