How to turn of collision for the player

Hi, I am making a drivable vehicle that I can enter and exit whenever I want, but there’s one problem, when I enter the truck it flies up into the air along with the player. And this is because of the collision between the player and the truck, so how do I turn of the collision of the “First Person Controller” prefab?

You should put your objects on different collision layers,
and then customize their interaction in Edit > ProjectSettings > Physics

in code you can just use gameObject.layer (not transform).

Put the Car and Player on different layers that don’t collide the moment you start the enter-car-animation.

alt text

alt text