- Home /
Game with Multiple Vehcicles - 1 Player
I have a game which has multiple vehicles (i.e. car, tank, helicopter etc) and I want to be able to press a button to toggle between each vehicle. I would like the camera to move to the vehicle that is currently being controlled as well.
Should I create multiple game objects for each vehicle, each with their own script containing variables like speed etc.
Could someone suggest the best way to approach this problem?
Answer by Mikilo · Mar 05, 2013 at 11:49 AM
Hi,
A good approach would be to create a Game Object for each vehicule with their own values. Destroying and instiating at every toggle could works, but you will lose your previous values. When toggling, you can move your camera's parent to the new vehicule. Or another way, if you have a specific camera for each vehicule, just swap the main camera.
Good luck.
Your answer
![](https://koobas.hobune.stream/wayback/20220613093845im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Keep character from jumping more than once? 2 Answers
Change material inside instanced prefab, gameobject.renderer is NULL 1 Answer
inventory class troubles :( 0 Answers
Changing prefab doesn't update instances (in scene aswell as in other prefabs).. 3 Answers
Remove HingeJoint2D from the Instance not from the Prefab 0 Answers