So my code gets to this part then just jumps ship.
For some reason or another even when this object is facing another object it’ll never trigger.
Just looking to see if anyone would have some idea as to why this would be.
float sightDistance_ = x;
if (Physics.Raycast(transform.position, transform.forward, out hit, sightDistance_))
{
Debug.Log(hit.collider.tag);
Debug.Log("Player Found!");
}
The player which this enemy is facing has a capsule collidor so there is something to collide with, its why I’m really confused about this.
Well I got it working but I kinda feel like I cheated because I just made a empty on the object which was +1y and +0.25z and shot the line from there then it worked
Actually I found the reason… and its funny yet sad cause it’s really been the reason why I’ve been having issues with my code all day.
My capsule collider was .5 smaller then my character controller.