Vehicles

I am trying to make a FPS in unity where you can get into cars, motorcycles, etc. Does anyone know how to do this or know a tutorial on how?

You want to write a script that says if a button is pressed/held, the person plays an animation, moves to the drivers’ seat, and ten becomes a child-object of the vehicle.

Sorry I don’t have a script for you. I’ve never actually done something like that before.

Thanks a lot! That realy helped

so basicly you would script it to say add fps prefab to the vehicle prefram or w/e if the e key is pressed? How would you use a camera thats behind the vehicle?

The main thing is that the rider/driver should be parented to the vehicle, so that when the vehicle moves, the character moves with it. The actual animations that show the player getting into the vehicle have to be developed for the specific vehicle models you are using (although you could possibly cheat by cutting to the inside view when the player is close to the vehicle). As for detecting when the player is close enough to get on board, you can use a trigger collider to report when an object is within a certain zone. See the section on triggers on the physics manual page for further details.

If you want to use a different camera for the vehicle, you can simply add more than one camera to the scene and disable the ones you don’t currently need.