Player gets trapped while exiting vehicle

Hello there! Lately, I’ve been working on developing a new car system for my game. I wanted to make the cars function differently, so I made them unable to collide with other objects and players. I was able to get to the point where players could enter the vehicle without any problems. However, while trying to exit the car, players would get stuck or trapped inside it.

I’ve tried to fix the issue by adding code to the “E to enter” car script. The code made the player move 10 studs to the left if the previous code was executed, but that didn’t seem to work very well.

As shown in the video, you can enter the car, but exiting it can be difficult.
robloxapp-20230829-2028432.wmv (1.6 MB)

I’m considering adding a local script to the vehicle seat that would move the player 10 studs to the left when they press the “Space” key while sitting. However, I’m not entirely sure this would work.

You could have a client-sided character script that uses GetPropertyChangedSignal to detect when the user’s SeatPart property changed to nil, and teleport their HumanoidRootPart outside of the vehicle.

I’ve done something like this in my game, and I would store the previous seat name before it changed nil to determine if I should teleport their character’s CFrame left or right (depending on the seat of the car, passenger teleports to right side, driver teleports to left side, etc.)

If this doesn’t work, you could make it server-sided and have the E-to-enter script store the player and teleport their character when the seat’s occupant property is nil.