Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 amuro21aya · Feb 01, 2012 at 04:46 PM · objectdestroy

Getting all Object to go next scene.

I have 4 object to destroy. But i need to program when the player gets only 2 object he need to go back to get the other 2 object left. I hope someone could help me. Thanks ...

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 Berenger · Feb 01, 2012 at 04:49 PM

Look over here : http://unity3d.com/support/documentation/ScriptReference/Object.DontDestroyOnLoad.html

Comment
Add comment · Show 8 · 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 amuro21aya · Feb 16, 2012 at 04:27 AM 0
Share

can you give me example . please !

avatar image Berenger · Feb 16, 2012 at 05:14 AM 0
Share

Create a new scene, save it and name it "a". Create an empty game object, and attach the following script (js):

var pouet : int = 0;
function Awake (){ DontDestroyOnLoad(gameObject); }

function Update(){
if( Input.Get$$anonymous$$eyUp("space") ) print( ++pouet );
if( Input.Get$$anonymous$$eyUp($$anonymous$$eyCode.Escape) ) Application.LoadLevel("b");
}

Save, then save as and name it "b". File-> Build setting, add the scene a and b. Reopen the scene a, run, play around with the key space and watch the output. Press escape, and play again with space.

avatar image amuro21aya · Feb 18, 2012 at 06:59 AM 0
Share

This is my script..

function OnTriggerEnter (other : Collider) { if(other.gameObject.tag== "p1") { Destroy(other.gameObject); score +=50; scoretxt.text = score.ToString(); print(score); gameObject.Find("Balisong").GetComponent("GUITexture").enabled = true; }

AND.. I don't know how to groin the script { DontDestroyOnLoad(gameObject); }

please help me ..

avatar image Berenger · Feb 18, 2012 at 07:15 AM 0
Share

What is it you need help for actually ?

avatar image amuro21aya · Feb 18, 2012 at 09:58 AM 0
Share

Actually,that is my code in destroy object with equivalent score then i want is when he did not destroy that object the player cannot proceed next level. And actually i have 4 object. $$anonymous$$y question is how can i use your answer using my destroy script.? Thanks

Show more comments

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Destroy the current GameObject? 7 Answers

Can't proceed next level when the object destroy not complete. 2 Answers

NullReferenceException - When destroying Object 1 Answer

Remove object based on its position alone 1 Answer

Dispose Object in IOS 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