How can I change sword?

I have a character with whom there are three kinds of sword,

and I want the first sword upgrades to the second one.

So I need to change sword.

I have come up with the idea that I can use the INSTANTIATE function - destroy one and

instantiate another at the mean time.

So I am wondering if it will work out and if there is a better solution for my situation.

My English is poor so I wonder if I made sense..

Thanks in advance!

As you said you can instantiate a sword, position it and pose it at his/her hand-bone(whatever you are using). Another way ( which i prefer ), is having all the swords parented under the character, then using code, only make the sword you want equipped visible. This has the advantage of easier positioning, and you can animate the sword in his hand as well!

At the appropriate time, use :

(yourCharacterObject) .transform.Find( path ).renderer.enabled = true;

to show a child model

the path is a string and looks something like this


depending on the setup of your bones.

Your english is fine!

Good luck!

There isn't a right or wrong way to do things in Unity. And what I mean by that is, there could be multiple ways of doing something that are all the "correct way". Try and avoid asking questions like this here (i.e. "Is this the right way?") because there is no definitive answer. Yes, your idea will work, but this is more of a discussion-type question than a straightforward answer, and is probably better suited for the forums than here.

See the FAQ for what this site is (and is not):