I would like to click somewhere on the ground, and when i click, an hitmarker appears at the exact position on the floor i clicked, to show me where the raycast landed so my character can walk to this place.
I succeed to do something drinkable, thanks to this tutorial : https://developer.playcanvas.com/en/tutorials/simple-shape-raycasting/
But the problem is when i change the camera from Perspective to Orthographic projection, the result is incorrect.
I took some screenshots so you can understand.
Maybe the way to calculate raycasts is different with this kind of projection ? To be honest, i don’t know.
Any ideas ?
Thanks by advance.
Perspective camera => https://i.gyazo.com/612ba1f1d6795b764f14b834e23ec7d2.mp4
Orthographic camera => https://i.gyazo.com/b9e260bf0304fd6e2c444279b1852319.mp4
Orthographic camera with different angle => https://i.gyazo.com/783b3b613ba0933350ec679a12fef1cf.mp4