x


Dont Destroy On Load Scene Return Problem

I have a game object that's supposed to stay in every scene throughout the entire game. However, for some reason whenever I return to that scene there are duplicates of that object and it causes problems with the variables. The object retains variables throughout several scenes. Is there a way that I can destroy the other object of the same name when I reload a scene. Example: I go from the main menu to a level, then I go back to the menu and there is another instance of the object which causes problems with the variables.

more ▼

asked Jun 18, 2012 at 04:59 AM

Chimera3D gravatar image

Chimera3D
684 135 111 128

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

1 answer: sort oldest

Its probly because each scene already has this object. Leave it in a starting 'buffer' scene only(scene you never return to after starting up the game. If you have the object in say, the main menu scene only, each time you return to that scene you will now have another instance of it.

more ▼

answered Jun 18, 2012 at 05:06 AM

hijinxbassist gravatar image

hijinxbassist
2.2k 78 63 76

Thanks bro!

Jun 18, 2012 at 05:21 AM Chimera3D
(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:

x1241
x1206
x662
x131
x15

asked: Jun 18, 2012 at 04:59 AM

Seen: 1414 times

Last Updated: Jun 18, 2012 at 05:21 AM