x


Find an object in a new scene that hasn't been destroyed?

How do I find an object in a new scene that hasn't been destroyed from the previous scene.

When my object makes it through the first scene, it has the DontDestroyOnLoad(object); code applied to it so it will stay in the next scene. How do I access the object to know its there in the new scene?

more ▼

asked Jul 09 '12 at 09:07 PM

WingedCross gravatar image

WingedCross
-2 1 2 6

(comments are locked)
10|3000 characters needed characters left

4 answers: sort voted first

Use gameObject.Find or gameObject.FindWithTag to locate it. Do this in the Awake or Start function so you only look for it once upon starting the new scene. Just avoid doing this in any function that needs to be called on a lot like Update, Fixed Update etc

more ▼

answered Jul 09 '12 at 10:15 PM

stingman gravatar image

stingman
562 24 29 33

(comments are locked)
10|3000 characters needed characters left

寓教于乐的游戏 武汉婚纱摄影 武汉SEO Buy cheap tibia gold here ,you can enjoy the fast tibia golddelivery! Rubera tibia gold - we are the professional Rubera tibia money, Rubera tibia gp, Rubera tibia accounthere, we can sell Rubera cheap tibia gold, Rubera tibia account, we have the perfect trading cheapest tibia gold system for Tibia Online players. Get Cheap guild wars gold with Instant gw gold Delivery! Your runescape gold & runescape money will be fast delivered to you ! We strive to offer the fastest and most reliable service on the web for all your gaming needs. Feel free to contact us 24 hours a day, 7 days a week by phone, live chat and email. We work hard with our suppliers to offer the cheap rs2 gold prices we can. If you find a lower runescape gp price somewhere please let us know and we will try our hardest to match it.

more ▼

answered Oct 15 '12 at 06:33 AM

hostman001 gravatar image

hostman001
1

(comments are locked)
10|3000 characters needed characters left

Thank you Stingman

more ▼

answered Sep 11 '12 at 01:10 AM

WingedCross gravatar image

WingedCross
-2 1 2 6

(comments are locked)
10|3000 characters needed characters left

Oh ok thanks Stingman

more ▼

answered Jul 09 '12 at 11:25 PM

WingedCross gravatar image

WingedCross
-2 1 2 6

no problem. but don't post comments as answers :) instead select my answer as the correct one and add a comment to say thank you. It clears up clutter and helps people find an answer easier when searching the site

Jul 09 '12 at 11:40 PM stingman
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

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

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1095
x717
x208
x180
x17

asked: Jul 09 '12 at 09:07 PM

Seen: 419 times

Last Updated: Oct 15 '12 at 06:33 AM