Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to allow player to change their color

Discussion in 'Editor & General Support' started by Grahamcracker25, Jul 24, 2023.

  1. Grahamcracker25

    Grahamcracker25

    Joined:
    Oct 18, 2021
    Posts:
    2
    Hello all, I'm unsure where to specifically post this so I figured here would be fine.

    I have a game that I have been working on for a bit now. The game is fun, casual and simple. I'm hoping for it to be my first actual commercial game as a indie developer. The game is basically: you are a ball, and you roll around, navigating your way through tracks that have a ton of obstacles, ramps, varying directions to roll though, things of that nature. Kinda like a Rube-Goldberg machine but you actually control the marble or ball going through it.

    All of my code works, the main menu is basically set up(I want to add in this part I'm asking in the question), some of the tracks are done however I saved that for last because I wanted to ensure that all the functions are right. Everything works great and it is basically at the point that it is a fully functioning game. However, I want my players to be able to choose a different color for their ball. I was going to do 4-6 preset colors to choose from (I plan on making a free-to-play version of the game, then having a DLC with more colors, and additional levels to play through). I haven't really found much exactly online about how to do that. I want the player to be able to simply, choose from the color and that becomes the color of their ball.

    If anyone has any tips, or tutorials for something like this, I'd love to hear it! I have searched a fair bit and haven't found anything, specific to what I need here!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Google provides some excellent starting points for picking the color.

    If you don't want to fiddle around inside of renderers or swapping out textures, just make different prefabs and put them in a pickable list. In that case, look for UI tutorials on picking things from a list.


    Screen Shot 2023-07-24 at 7.17.55 AM.png