Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Jin · Mar 24, 2010 at 07:02 AM · change

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!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by ZanzibarDreams · Mar 24, 2010 at 09:13 AM

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

"root/spline1/spline2/spline3/Rshoulder/Rarm/Rforearm/Rhand/Rfinger/REND/AwesomeSword"

depending on the setup of your bones.

Your english is fine!

Good luck!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jin · Mar 24, 2010 at 02:36 PM 0
Share

O$$anonymous$$, thank you~ I will try in this way! :)

avatar image
1
Best Answer

Answer by qJake · Mar 24, 2010 at 07:29 AM

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):

http://answers.unity3d.com/faq

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Lipis · Mar 24, 2010 at 09:57 AM 1
Share

I think it's an O$$anonymous$$ question to get two different methods on how to swap a sword...! But even if you're right this post should be a comment.. it's note exactly an an answer that Jin is looking for.. :) He already knows that it's working..

avatar image Jin · Mar 24, 2010 at 02:35 PM 0
Share

Thank you SpikeX and Thank you Lipis~ :D

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Skybox not changing (through code) 0 Answers

I want to change the object position random in five particular position only. 0 Answers

just a simple question.. 1 Answer

Changing model during runtime after button pressed 1 Answer

Change the direction of velocity upon tapping a button!!?? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges