Change model by another one

Hi,

I have this

alt text

I’m trying to change the basic model by the upgraded model. (Not the gameobject)

After search, I found this idea :

var mesh : Mesh ;
GetComponent(MeshFilter).mesh = mesh;

It works, but as “mesh” I can only put “Group000” or “Group0001” of the upgraded model, and so I have only 1/2 part of upgraded model.

I don’t have the solution for such easy-looking task :frowning:

Thanks

You’ll need to combine your geometry in whatever 3D suite you’re using.

Alternatively, consider swapping out your player models as children of your GameObject.

Thanks for the answer

You’ll need to combine your geometry in whatever 3D suite you’re using.

My “upgraded player” with the “bag” need 2 “mesh filter” (one for each part) so I think I can’t do that.

Alternatively, consider swapping out your player models as children of your GameObject.

I just tried to do this… so I put my “upgraded player” as child of “player” and I put this in the script :

Player.renderer.enabled = false;
Player2.renderer.enabled = true; (child of player)

I am not sure this is the best solution, but that work…
I’ll wait some more and if no better solution I’ll consider your answer as correct, thanks.

P.S : So hard to just change a model, in others program it’s like you just have to change player.fbx by playerupgraded.fbx and 0 problem. But Unity far ahead on others points of course :y