Search Unity

Car Selection Menu - Any availible scripts?

Discussion in 'Scripting' started by woodsynzl, Jul 29, 2015.

  1. woodsynzl

    woodsynzl

    Joined:
    Apr 8, 2015
    Posts:
    156
    Okay so I've made a few different car prefabs - I want to:

    • Make a list in the main menu showing different vehicles

    • Make another list so that the user can choose a map

    • Create a spawn point on each map so that the individual cars can spawn there

    • Make the camera notice the player car and focus on the car on load
    So I hope it can go like this - Menu>CarSelection>LevelSelection>Game

    Any help would be awesome!

    Here's a link to the current build (http://gamejolt.com/games/freedrive/78575)
     
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148


    should cover the basic UI principles of the first two


    spawn points are generally just an empty gameobject in your level, the level's script will need to put the correct prefab there.... so the trick would be passing the information from the menu selection to the level script. Some sort of game manager script would work there (menu populates variable, level script read variable etc.). Look up DontDestroyOnLoad() function to ensure the game manager survives the transition from menu scene to level scene.

    easiest way would be to tag the player car and have the camera script FindWithTag() and LookAt() the transform...
     
  3. woodsynzl

    woodsynzl

    Joined:
    Apr 8, 2015
    Posts:
    156
    Cheers for that! I'll check it out
     
  4. SuryaPrakashModi

    SuryaPrakashModi

    Joined:
    Mar 11, 2018
    Posts:
    9


    Watch this video.
     
  5. c2rgames

    c2rgames

    Joined:
    Aug 2, 2017
    Posts:
    1
    i have made my car selection based on this video. everything is working fine but there is only one problem. after level completing when i go to main menu, and then car selection. the previous selected car also instantiate in car selection menu. Can you help me. please
     
  6. SuryaPrakashModi

    SuryaPrakashModi

    Joined:
    Mar 11, 2018
    Posts:
    9
    if you explain more then i can help you. like if you can send me video then it would be good.