• 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 /
  • Help Room /
avatar image
0
Question by 3onsay · Nov 21, 2015 at 07:25 PM · instantiation

Instantiate an Object after collecting items

I want after the player collected all the items (cubes), to appear another cube wich, when the player collide with it, will change the level to the next level

I've tried the instatiation command to make the cube appear but it doesnt work. This is my script so far: alt text

Can anyone help me? Thanks

anonimo.png (16.5 kB)
Comment
Add comment · Show 5
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 gjf · Nov 21, 2015 at 02:15 PM 1
Share

please post code not screenshots of it, and formatted correctly - it's easier to read for people trying to help you.

and importantly, explain (as best you can) how it's not working...what do you expect it to do? what does it actually do?

better questions usually yield better answers ;)

avatar image 3onsay gjf · Nov 22, 2015 at 03:00 PM 0
Share

Right now I've solved the problem of making the cube appers by modifying the script of the PlayerController like this:

}

         if (count >= 3)
         {
             Instantiate(cube, new Vector3(28, 1, 7),Quaternion.identity);
         }

And it actually works, when the player collects all the items the cube appears correctly

Now I'm wondering if i can change the Vector3 of the cube to instantiate or not. I mean, in different levels, change the position of the cube without using another script. Thanks @gjf

avatar image Vunpac · Nov 21, 2015 at 09:02 PM 1
Share

also it looks like you are checking if count >= 8 I don't see count defined anywhere.

avatar image fredz0004 · Nov 23, 2015 at 11:09 AM 1
Share

You can make vector public and change it to what you want on each level.

avatar image 3onsay fredz0004 · Nov 23, 2015 at 12:42 PM 0
Share

Ok, Thanks :)

0 Replies

· Add your reply
  • Sort: 

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

7 People are following this question.

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

Related Questions

The AI-Players do not see new install (Instantiate) object (the ball) after they set the first goal in gates and old object (the ball) was destroyed. 0 Answers

Instantiating multiple interactive prefabs 0 Answers

my instantiation /prefab of dan wont play death animations like orignal dan 0 Answers

Prefabs aren't instantiating where they should be 0 Answers

A question about direct references... 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