How do I code one Ball to be a universal player?
Hello to all that read my request and thank you for taking part of your time to consider assisting me. I'm fairly new to Unity, so hopefully you would understand what kind of struggle I'm having with trying to create a big game. This is my situation, my bowling game contains 9 balls. It has three scenes just for these balls; therefore, there are three scenes and three balls on each scene.All of them have different materials on them. I've come to realize that it would be way more convenient if I could make one ball option scene (opposed to three) .Then, figure out how to make one ball and cause it to change it's material every time the player clicks on it.Afterwards, I need my game to recognize what material the ball options menu has and cause the ball the player uses in the game to have that same material.Most importantly, I need it to also work for my multiplayer option I'm working on; it can't be finished unless I find a way to make ball option scene to work in the way I asked.The reason why is because NetworkManager only has one slot for the player prefab and I want to use all of my materials for my balls in my game. So as you can see,the one ball option scene design would be extremely convenient for me and the player for many important reasons due to my specific plans for my game.Right now, I have absolutely no clue how this should be done.I don't know where else to go to find the information I need.I'm very impressed of how many of you here are highly advanced experts on Unity. My goal is to become at the level of mastery of Unity some of you are! Can any of you lend me some detailed advice on how to do this? Any help at all would be immensely appreciated!
@ElementalVenom, I'm not sure if you understand what I asking for.I'm sorry if what I said is unclear. What I mean to say is that I just want to have one ball option scene with one ball in it acting as a universal model for all of the nine balls that I have; it will be like there's nine balls in one. That universal model should behave as a button; every time a player click or press it, the model should change it's material.For example, the universal ball model may display a Earth material on it.However, if a player presses on the ball model, it will change it's material to something else ($$anonymous$$ars for example).If the player keep pressing on the model, it will keeping changing through the nine materials.(Just to let you know, all nine of my bowling balls resemble either a planet or galaxy, so that's why I used Earth and $$anonymous$$ars as an example.) I want my game to look at whatever material is presented on the universal ball model and change the player's ball (that will be used to play with) to match that material on the model. I hope this explanation clears everything up!
Answer by ElementalVenom · Jan 02, 2016 at 04:11 AM
Make it into a prefab. Drag it from the hierarchy to the assets folder. It should then glow blue in the hierarchy and when you edit it just hit apply in the top left of the inspector.
Answer by hillamanda · Jan 04, 2016 at 11:59 PM
I just found a genius way of doing what I wanted! I'm in the process of making the scripts for it right now.I'm making the scripts and I'm going to test it on one of my other games.Then, I'll code my bowling game the same way.When I'm finished, I'll come back and share what I have done.
Your answer
Follow this Question
Related Questions
Post time at the end of the level 0 Answers
My project's UI keeps resizing itself and I have no idea why. 0 Answers
Spawn prefab on UI button click 0 Answers