I’ve used raycasts many time before and never had an issue, but for somereason, in this project specifically. Raycasts refuse to function.
Collision matrix is properly setup.
Objects/terrain has colliders
Layermask is set up, set to everything in test.
void FixedUpdate()
{
if (Physics.Raycast(transform.position, Vector3.down * 50, out hit, 1f, layerMask))
{
Debug.DrawRay(transform.position, Vector3.down * hit.distance, Color.green);
Debug.Log("HIT");
}
else
{
Debug.DrawRay(transform.position, Vector3.down * 50, Color.red);
}
}
Any ideas on any external elements that might cause raycasts to never return hits?