Car Entering

I’m looking for the best way to make my player get inside the car, i want it so that you disappear into the car and camera changes to the one just above the car but somehow destroys my player until i exit the car then he re spawns.

You probably don’t want to completely disable you character. You can just disable the rendering and physics components of your character once the transition into the vehicle is complete. Something like:

renderer.enabled = false;
rigidbody.enabled = false;

That way, you can continue to use the other components on your character.

For transitioning the camera, I would have a GameObject in the car’s hierarchy that represents the cameras mount point on the vehicle, with a script that controls a camera in the context of driving the car.

As the transition into the car occurs, you can have the camera position and rotation lerp to the position and rotation of the mount point gameobject. And then once the lerp is complete, you can make the camera a child of the mount point, so the mount point script can take over.

You may also want to do a similar mount point and script to control the camera in normal mode. Then you would transition the camera like this.

  1. Un-child Camera from Character mount.
  2. Lerp Camera to Car mount.
  3. Child Camera to Car mount.