Swaping models appearance through script

Hello. I’ll get straight to the point.

What i need to do in my game is next : I have instantiated a model , call it model a. Now somewhere in the script , it was decided that the model a is given a special function , and now it needs to take new appearance. Now i have made a prefab out of a model b , and i need model a to look like a model b , without having to instnatiate model b again , or destroy model a , just make model a take appearance of model b. That’s all , thanks in advance

The simplest way to make a big change (not just color or an extra arm) is to carry around an invisible model B with you. Then “turn off” A and “turn on” B, using SetActive.

With 2+ things, often easiest to have a parent and both of them children. The parent might have the script, rigidbody or charController, maybe the collider (if the models can share one,) audioSource … everything but the models. Drag model A and B in as kids and, by hand, check B inactive. To swap, use transform.Find("modelA").gamebject.setActive(false); and again with true for model B.

It is possible to have only a single model, and reach into the meshRenderer and swap just meshA for meshB, but you probably also want to swap the texture, material, possibly bones. Maybe they even have little slime-dripping emitters… . So setting them both up as complete gameObjects will let you swap all the stuff in one step.