Everything ignore my path(Layer and Tag)
So, I've done SphereCheck and Raycasts(Would prefer Raycasts). Both are completely ignoring the only gameobject I want them to see in this case.
Here is what I am trying to work with =
previewPosition is a Vector3 I declare further up.
if(Physics.Raycast(previewPosition + Vector3.up *3, Vector3.down, 10f,LayerMask.GetMask("Path")))
{
Debug.Log("You can't build on the path");
return;
}
currently, it always returns false, so never enters. I've read the ~ (Binary opperator) stuff, and it just makes it return true every time.
My path is both tagged and has a the Layer "Path" have tried detecting it both ways, neither are working.
Your answer
![](https://koobas.hobune.stream/wayback/20220613001819im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Cannot figure out how to measure the distance of a raycast being sent out to the side of an object 1 Answer
SphereCastAll hit.point are allways zero 1 Answer
Player sticking walking around inside tunnel.. Raycast HOW? 0 Answers
Raycasthit changes behavior after certain time 0 Answers
How to make a Physics.Raycast detect a FPSController? 0 Answers