The question is answered, right answer was accepted
How to change main character model via script?
Hello! I'm looking for some advice how I can change the main character (3d model) in game if for example I buy new model new in in game shop? Can you recomend some tutorials maybe?
Answer by TheFloatingSheep · Jun 23, 2016 at 10:19 AM
There's multiple ways. But... What i suggest you do is, instead of just placing the GameObject in the scene window, drag it into your Assets folder, to make it a prefab, and delete it from the scene. Then, make a script with a static variable that instantiates it when the Start function is called. And in the menu where you buy new characters, you can just set the static variable to the prefab of that shop item.
I'm not going into details right now as i don't even know what language you're writing in, but, if you have any questions about how to do this, feel free to ask in a comment.
What i suggest you do is, ins$$anonymous$$d of just placing the GameObject in the scene window, drag it into your Assets folder, to make it a prefab, and delete it from the scene. Then, make a script with a static variable that instantiates it when the Start function is called. And in the menu where you buy new characters, you can just set the static variable to the prefab of that shop item
Nice idea, Thanks bro. :)
No problem. Feel free to click the "accept answer" button xD. It would help with my reputation score.
Follow this Question
Related Questions
Input Dispatching issue ANR reports in Unity 3D Game on Android platform 0 Answers
How to convert keyboard inputs to Circle Pad with n3ds 0 Answers
Keep an object perpendicular to the surface it collides with and parallel to the floor 0 Answers