Pick mesh with mouse or tap


In my game, the user/player may click/tap anywhere on the screen. Now I should be able to map the screen coordinates to 3d coordinates and pick the mesh at those coordinates.

How can I do that?
Is there any event something like scene.OnClickOnAMesh ?

Thanks in advance.

You can use raycasting for this: https://doc.xenko.com/latest/en/manual/physics/raycasting.html

1 Like