Raycasting for collision and multiplayer

I’ve followed some guides on how to make my own character controller but I’m now currently stumped on a certain problem. I want to collide with other players as well. This controller script is also used for the boxes and I also want them boxes to collide with each other. This makes using the Layer Mask quite tricky.

Things I’ve tried:
Setting “Queries Start In Colliders” (currently using it ticked on)

  • Having it ticked on means that I can’t set my Collision Mask Layer to “Player” as the player will collide with himself forcing a weird interaction causing a weird movement, so that means I can’t detect other players in the Player Mask
  • Having it ticked off: There are bugs when I untick it since I use raycasts with a “skin” for collision checks (generated from within), and when a “pointed” collider gets past some of the rays and somehow end up inside the player (moving too fast/low framerate) the rays emitted from inside do not detect the collider that has overlapped into the player’s body (unticked Queries Start In Colliders completely disables Raycast collisions when inside the initial body).

Using RaycastAll - It is very buggy as when RaycastAll is used for collision detection it sometimes “misses” some colliders thus going through them (e.g. when jumping on the foot of a slope, it ignores the foot of the slope and lands on the actual flat ground itself). Using RaycastAll also seems to be CPU intensive so I don’t think it should be done this way as well.

I’ve also seen this:

And tried to approach it similarly but a collision occurs at the ray origin. Using the tag though might be a workable idea. So is using, let’s say, the player’s gameID (or tempID) or ingame name as a tag to be ignored a good approach or is it bad practice? Or is there something that I’m missing somehow, I might be over-complicating things or something. But if I do this, that would mean I won’t be able to do it to the movable boxes (box to box collisions) unless I give each of them unique tags or something. I might be approaching this the wrong way as well…

BTW for reference, most of what I learned for this was from Sebastian Lague’s 2D Platformer Controller

I’ve been searching for quite a while now and I’m hoping someone could lead me to the proper direction. I haven’t used a Rigidbody yet but it’s starting to feel like I’m going to have to, though I really prefer not to. If there was a way to set the “Queries Start In Colliders” for each Raycast then that could probably work as well.

Shot in the dark but did you ever figure out the solution to this? I have not found a solution looking online so far