Always detecting walkable layer only

I’m having a small issue where my PlayerMovement script is only hitting on a walkable layer, or the out of range if i curse completely off anything walkable. In my scene I have some Ethans marked as ‘Enemy’ layer, and I have some blocks that are set to default, so they shouldn’t be walkable. If i curse or click on either of those two things it still just hits and returns the walkable layer. I am using the scripts exactly as they are found in the lecture, and i have made sure i applied the layer to all children of the game objects.
Does anyone know what I am missing?

In case anyone else has this issue, it ended up being the fact that i was using the Ethan model as my enemy, and i guess the version of it that i am using doesnt have a collider, which im betting the raycaster uses. I put a cube in and tagged it emeny and it works just fine.

Privacy & Terms