Camera Question.

I’m making a game that involves the character entering a vehicle. I have an idea on how tio do this but I’m unsure. when the “E” button is pressed within range of the vehicle, the player will disappear and a new camera will be placed in the vehicle. My idea was if the player is touching the vehicle and presses “E” the gameObject will be destroyed and the next camera available will be the one in the vehicle. The only thing is how would I go about doing this?

Try putting a script on the camera instead to move it where you want it.

There will be a performance overhead associated with destroying and recreating a camera. Besides it’s unnecessary.

You can move a camera ‘instantaneously’, so to the player it will appear to be a different camera.

As for scripting, I’d recommend doing all the tutorials first.

The only thing is the player itself needs to be destroyed. also, what would the script be?

You don’t destroy a gameobject unless you don’t ever need it again. I imagine your player can also leave the vehicle? If so, you want to disable him, not destroy him.

As for the camera - he easiest thing to do would be to detach it from the FPS (or whatever) player and attach it to the vehicle. Every easy.

Thanks. I have the idea of what to do, but how would I go about doing it?