Hello, I’m making a first person horror game and i’m facing a problem early on, so i have this camera that shoots a raycast downwards to see what layer it hits and plays the footsteps audios in an array according to what layer it hit(if it hits a game object with the tag “forest” it plays the forest footstep audios in an array randomly) the problem is for this to work i have to place the camera slightly infront of the player collider, which was okay with me until i noticed that the camera is now clipping through walls, so i moved it back again the clipping problem is solved but now the raycast is hitting the player collider so it’s not playing any footsteps. I tried shooting the raycast from the player collider it self to avoid a problem but this way the footsteps do not work properly when i jump or crouch for some reason. So i think that the best solution is for the camera raycast to ignore the player’s collider and detect what layer is the player standing on. Any ideas on how to do that?
Okay i found it, just set the game object’s layer that you want to ignore to “Ignore Raycasts” in the inspector, this took more time than it should have and i don’t feel good lol.