How can I make a car selection screen for my game? For example I want to choose from different cars and the car that i selected will be the car that i'll be driving in my (island level-example)... It's something related about Object.Don't DestroyOn Load script?
There are several ways to do this. Here are a few:
To switch cars in one scene:
- You could do something as simple as turning renderers on and off.
- For most games, the more reasonable solution is to destroy the current instance of your car and instantiate a prefab for a different one and/or replace specific car parts, if your game includes that level of customization.
To drive that vehicle in a different scene:
- You could simply call DontDestroyOnLoad before loading your other scene with something like `DontDestroyOnLoad(transform.gameObject);`
- You could store some static variable somewhere indicating the prefab to use and then instantiate the appropriate prefab in the second scene.