Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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
0
Question by hugemaggot · Dec 17, 2010 at 07:47 PM · inventoryrpgpickupequip

picking up and wearing armour

im making an rpg game but i dont know how i would pick up an object (armour) then it dissapear from the floor and apear in my inventory (which i dont have) and then be able to wear the object. i know this is probably very complicated and will require a lot of effort but please can anyone help me with any of this?

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

1 Reply

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

Answer by The_r0nin · Dec 17, 2010 at 08:02 PM

You have to break it down into much smaller steps and then figure out what each step requires. For example, if I were doing it, I would list out the following:

  1. create an object to be picked up.
  2. put a script on the object and in its OnTriggerEnter(), have it call a function on the player that identifies what item to add, and Destroy() itself.
  3. create a script on the player that holds the inventory in a list or an array. Add a function that, when called, checks the number that is input and add that number to the next slot in the list/array.
  4. As for wearable armor... that would require a much longer list just to work through (do I need to create separate torso meshes based on the armor shape, or will it just change the material on the player mesh? How do I match the number in the inventory with the specifics of the armor? etc.).

The thing is, if you try to do everything at once, you'll never get anywhere. Try separating what you want to do into much smaller steps (first this has to happen, then this) and think in terms of what the objects and scripts are doing, not what the player will see or think is happening.

Oh, and one last thing... you might want to start smaller. If you aren't comfortable with the basics of Unity and what it can do (and more importantly, how it does it!), you'll never be able to work out the harder stuff. Consider a simpler game first, then build on it. Which is better, a guy who runs a 5-mile marathon and finishes, or a guy who starts a 25-mile marathon and never reaches the end...?

Comment
Add comment · 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

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

Button Listener void calling all prefab buttons in scene. 1 Answer

Brackeys Inventory Package, adding icons to empty slots... 0 Answers

Picking up Objects (from within the player's code) 1 Answer

MissingReferenceException Help Please! 0 Answers

Inventory System- Best to Instantiate or Activate equipped items? 0 Answers


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