which is what I’ve made but the resoult is this:
What you want to do is set the GROUND to a layer by itself, I call that layer “Ground”
Then the layermask only contains Ground
I got it!
It wasn’t working 'cause we miss a parameter here, so he was supposing that the layerMask was the maxDistance, indeed by adding Matf.Infinity is working fine.
bool hasHit = Physics.Raycast(GetMouseRay(), out hit, Mathf.Infinity, layerMask);
Now I will find a nice way to calculate a reasonable distance for the RayCast and this issue will be defintely closesd.
Thank you for the support, and sorry for the bother.
It’s definitely smaller than infinity. I would try somewhere between 50 and 200
1 Like
“Frickin’ laser beams!” Love the Austin Powers reference