I am trying to make hit boxes on my player but I don’t want it to be effected by colliders. Any ideas?
Yes, Raycasts only “collide” with colliders.
You can add a collider to your player and mark it as trigger, so it won’t be affected by physics.
You can use an “opposite” ray cast. Camera.WorldToScreenPoint(transform.position)
will give you the pixel location of your player on the screen. You can then compare to raw mouse pos for however far away you want, in pixels (or can use 0-1 ViewPorts coords and check using screen%.)
The trick only works if you have a few things you want to check, like only the player in your case. Because you have to convert each one to screen coords (whereas a rayCast converts the mouse coords to world once and using the fast collision system to check.)