Physics.Raycast not colliding for seemingly no reason

Physics.Raycast(cameraMain.position, cameraMain.forward * interactRange, out RaycastHit info, interactRange, LayerMask.NameToLayer(“Interactable”), QueryTriggerInteraction.Collide);
This code SHOULD be working, however it just never finds an interactable object. I don’t see any issues. I’ve looked at the ray I’m putting in with Debug.DrawRay, it is correct. The object is on the Interactable layer, its collider is a trigger, so I’m out of ideas on why this just isn’t ever finding anything.
Everything looks correct, I’m not sure why it’s broken.

@Lionmeow If I remember correctly, you should only need

Physics.Raycast(rayStart, rayForward, rayLength, hitInfo) 

and then filter the hitInfo after.

if (hitInfo.LayerMask == "Interactable") { // do logic... }

It has been awhile since I used Rays, so above code is not spot on, but hopefully helps you figure it out :slight_smile: