- Home /
Raycast not detecting NavMeshAgent
Hello,
I have a problem where raycasting from an NPC NavMeshAgent doesn't detect player agent (note that any other colliders are detected just fine, only one that is being ignored is player).
I have tried detecting with various variables (layerMask, hit.collider, hit.transform, hit.rigidbody, tag and name) and none of them worked.
Both player and npc have NavMeshAgent, Rigidbody, Capsule collider and couple of script components. I have also tried changing collision detection on rigidbody component but none of the options changed anything in regards to the problem.
If anyone has encountered this problem before any advice would be much appreciated.
Give us some sample code, for example where you do your raycast. Maybe also screenshot your components for the player