Stopping parts from colliding with Default but still work with raycasting

I have a door system that works through physics (HingeConstraints). I planned on having them through CFrame but because of how many doors there are and other details, this wouldn’t work.

My problem is that sometimes the doors can get stuck on walls in the map and other parts. So I tried getting over this by having a collision group just for the doors, which does not collide with Default so that it will just go through them. (Characters have their own collision group).

The problem with this is that ROBLOX added a stupid feature that means that raycasting ignores any parts that are in a collision group that does not collide with Default. Because of this, my methods of raycasting with doors to check if a player can reach them etc etc will not work.

I tried to get over this problem by setting the collision group of the doors back to default on the client (as the physics of the doors are controlled by the server). This works, however, there are lots of bugs. Sometimes they just glitch out when you approach them:

Example

What is the best way to overcome this problem? Physics doors that do not collide with the map, but collide with characters and work with Raycasting. I considered having a special collision group for the map but then things can get complicated, as 9 collision groups already exist.

1 Like