• 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 mattlewis83 · Jul 12, 2013 at 05:44 PM · scenedestroy

results screen using destroyed objects as score

my game has enemies who's A.I. scripts are disables upon a trigger enter. when this happens they are still... and dead. on the same trigger i have a cue animation script that sends a cube that is located in the upper left hand corner (to represent a killed enemy) up into another trigger that destroys it on trigger enter. i did this so my enemy's would still lay around the area and i could add a script that basically checks to see if items with "tag" are still present in the scene. if the search yeilds null then it loads a new scene. so my question is... in the new scene, how can i take the cubes that were destroyed and have them appear in the new scene... as if to say... you were able to kill [] [] [] [] [] before the time ran out?

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

Answer by jaakaappi · Jul 12, 2013 at 07:20 PM

http://docs.unity3d.com/Documentation/ScriptReference/Object.DontDestroyOnLoad.html

This makes the gameobjects stay where they are when you load a new scene by not destroying them.

http://docs.unity3d.com/Documentation/ScriptReference/Application-isLoadingLevel.html

This is a boolean that is true if the game is loading a new scene.

http://docs.unity3d.com/Documentation/ScriptReference/Application-loadedLevel.html

Aand this one tells the index of the level that is currently loaded. By combining these three you can make your gameobjects survive the otherwise fatal scene loading and re-position themselves after a new scene has been loaded.

In case you have any further questions please add a comment and I'll try to answer.

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 mattlewis83 · Jul 16, 2013 at 02:35 AM 0
Share

thank you i will check those out

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

16 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Destroy All Objects In The Scene??? 1 Answer

using Contains(gameObject) to find and destroy a gameObject from a list 2 Answers

How can I delete the Main Camera using a script? 1 Answer

How to prevent objects instantiating between scenes? 4 Answers

How to disable Dont destroy on load 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