- Home /
How to change a part of a model dynamically?
Hi all Unity users.I have a problem while I am making a racing game. The car in this game is designed to be composed of a body(a fbx file) and tires(each type has a Separate fbx file) and the player can switch the type of tires dynamically during the game.What should I do to create the car model with a car body and tires.Should I duplicate the car body for each type of tires? That means if I have ten types of tires, there would be 10 Gameobjects named "car" which are composed of different tires. That seems to be too complicated....Need help! Thanks!
Answer by fafase · Jan 08, 2012 at 04:02 PM
You should be able to enable/disable objects via script. with object.active= false/true;
This way you have all of your tires children of the car, they are all there but only one is active, visible and used at a time. While changing tires, for example at pitstop, you can have a little animation and at the end of it, you switch the active you need on/off.
I understand it is easier said than done...but that could give you an idea
That would be a way to solve my problem. Thanks a lot!