• 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
Question by CB-TV · Nov 20, 2012 at 04:32 PM · objectcollectible

How Can I Make Collectable Objects?

I would like to make some collectible objects for my video game. If you have ever played Assassin's Creed Revelations you will know that you can collect data fragments. I would like to make that sort of thing in my game with around 100 objects hidden around my world and when you collide with them they disappear and (For instance) it says "1 out of 100 skulls collected". I would also like it if when you collect all the collectibles, you unlock a special mission or something. Can you help me please? That would be great!!!

Comment
BiG

People who like this

-1 Show 2
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 AlucardJay · Nov 20, 2012 at 04:44 PM 0
Share

Don't take this rudely, but what level are you at? In both your coding and game? Half of me wants to help for future readers and half of me wants this closed for being to ambiguous/vague. Think about what you have already said :

  • with around 100 objects hidden around my world

  • when you collide with them they disappear

  • it says "1 out of 100 skulls collected"

  • when you collect all the collectibles, you unlock a special mission or something

You have already described the steps to achieve this.

  • have a builtin array, drop your 'skulls' in the inspector

  • each collider has a script that (1) disables the gameObject and/or (2) adds to some counter

  • (1) read how many objects are disabled in the array or (2) read some counter

  • if some counter > 20, unlock1 = true;

avatar image AlucardJay · Nov 20, 2012 at 04:44 PM 0
Share

http://answers.unity3d.com/questions/133869/how-to-ask-a-good-question.html

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Democre · Nov 20, 2012 at 04:55 PM

I think you've identified how you want to do it, just do it in steps.

I would like to make that sort of thing in my game with around 100 objects

Make an array of collectables in a manager class or just a counter, depending on your needs

and when you collide with them they disappear

Make a behaviour script that destroys the game object in OnCollisionEnter or OnTriggerEnter and then attach that to a prefab.

and (For instance) it says "1 out of 100 skulls collected"

In the above collision behaviour script also send a message to or call a method on your manager (the one with the array) and either change your data array or bump the counter. Then display a message from the manager.

I would also like it if when you collect all the collectibles, you unlock a special mission or something.

In the manager script, when it receives an updated count, check the necessary requirements for a mission or something and if those are met, unlock it.

If you need help with specific scripts, post the code you have and describe how it has failed to meet your expectations, and we can try to help you out. We won't write your code for you for free. If you want your code written for you, post in the commercial or collab forums.

Comment

People who like this

0 Show 3 · 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 AlucardJay · Nov 20, 2012 at 04:57 PM 0
Share

Pretty much the same as my comment :/

But may as well leave it, it has more description which will help future readers. The OP really need to modify or remove this question.

avatar image Democre · Nov 20, 2012 at 05:01 PM 0
Share

Sorry, must have been writing as you posted your comment

avatar image AlucardJay · Nov 20, 2012 at 05:07 PM 0
Share

That's fine, leave it posted. Am also half frustrated at the question.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How do I keep objects destroyed between scenes? 1 Answer

Check if an object is changing position C# 3 Answers

Class inheriting Runtime Classes 1 Answer

Find open position 1 Answer

Drag Player touch ios 2 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