Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Share
Go down
Member [Lv. 3]
Member [Lv. 3]
Posts : 17
Points : 1252
Rep : 0
Join date : 2015-04-07
View user profile

Unity Scene turns dark after reloading level during runtime.

on Tue Apr 07, 2015 4:47 am

this video explains my problem.
Please help.
avatar
Member [Lv. 3]
Member [Lv. 3]
Posts : 16
Points : 1253
Rep : 0
Join date : 2015-04-13
Age : 26
Location : Milwaukee, WI
View user profilehttp://vgbam.com/

Re: Unity Scene turns dark after reloading level during runtime.

on Mon Apr 13, 2015 4:21 pm
Is there any script that involves affecting the light?
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2143
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Re: Unity Scene turns dark after reloading level during runtime.

on Tue Apr 14, 2015 11:14 pm
Seems as though your light that you are using get's destroyed on reset of the level Sad

use something like this:
function Start () {
DontDestroyOnLoad(transform.gameObject);
}

You should be fine after that, it was just destroying your light that's all Smile

-BryceCain25
=)
Member [Lv. 3]
Member [Lv. 3]
Posts : 17
Points : 1252
Rep : 0
Join date : 2015-04-07
View user profile

Re: Unity Scene turns dark after reloading level during runtime.

on Thu Apr 16, 2015 2:17 am
BryceCain25 wrote:Seems as though your light that you are using get's destroyed on reset of the level Sad

use something like this:
function Start () {
DontDestroyOnLoad(transform.gameObject);
}

You should be fine after that, it was just destroying your light that's all Smile

-BryceCain25
=)
Thank you bryce...
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2143
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Re: Unity Scene turns dark after reloading level during runtime.

on Wed Apr 22, 2015 5:43 pm
Zachvlol wrote:
BryceCain25 wrote:Seems as though your light that you are using get's destroyed on reset of the level Sad

use something like this:
function Start () {
DontDestroyOnLoad(transform.gameObject);
}

You should be fine after that, it was just destroying your light that's all Smile

-BryceCain25
=)
Thank you bryce...
Sure thing!
Member [Lv. 3]
Member [Lv. 3]
Posts : 17
Points : 1252
Rep : 0
Join date : 2015-04-07
View user profile

Re: Unity Scene turns dark after reloading level during runtime.

on Sat May 30, 2015 5:45 am
BryceCain25 wrote:Seems as though your light that you are using get's destroyed on reset of the level Sad

use something like this:
function Start () {
DontDestroyOnLoad(transform.gameObject);
}

You should be fine after that, it was just destroying your light that's all Smile

-BryceCain25
=)

I came acrost this again but your script is not working it still does the same thing.
would you know any other way it should work?
avatar
SUPER MODERATOR
SUPER MODERATOR
Posts : 279
Points : 2143
Rep : 58
Join date : 2013-12-16
Age : 17
Location : Boise Idaho United States
View user profile

Re: Unity Scene turns dark after reloading level during runtime.

on Mon Jun 22, 2015 6:08 pm
Zachvlol wrote:
BryceCain25 wrote:Seems as though your light that you are using get's destroyed on reset of the level Sad

use something like this:
function Start () {
DontDestroyOnLoad(transform.gameObject);
}

You should be fine after that, it was just destroying your light that's all Smile

-BryceCain25
=)

I came acrost this again but your script is not working it still does the same thing.
would you know any other way it should work?

Sorry for the late response, been busy with Summer School, however, it could be that you didn't replace the "Light" variable in the inspector, could be, could not be, however i do know that this is your problem, lights can be destroyed on load because Unity feels like it is not needed (or to some extent). Report back to me if you seem to be still having problems. Make sure to add it to the light itself, and assign the light variable in your inspector
Member [Lv. 3]
Member [Lv. 3]
Posts : 17
Points : 1252
Rep : 0
Join date : 2015-04-07
View user profile

Re: Unity Scene turns dark after reloading level during runtime.

on Thu Jul 09, 2015 12:41 pm
BryceCain25 wrote:
Zachvlol wrote:
BryceCain25 wrote:Seems as though your light that you are using get's destroyed on reset of the level Sad

use something like this:
function Start () {
DontDestroyOnLoad(transform.gameObject);
}

You should be fine after that, it was just destroying your light that's all Smile

-BryceCain25
=)

I came acrost this again but your script is not working it still does the same thing.
would you know any other way it should work?

Sorry for the late response, been busy with Summer School, however, it could be that you didn't replace the "Light" variable in the inspector, could be, could not be, however i do know that this is your problem, lights can be destroyed on load because Unity feels like it is not needed (or to some extent). Report back to me if you seem to be still having problems. Make sure to add it to the light itself, and assign the light variable in your inspector
Thank you, working with the light still doesn't work. I have decided to teleport the player back to the start when it falls off. it works better than loading the same scene over and over. I used a blank object with a huge cube collider with the trigger
Code:

var player : gameobject;
var spawn : gameobject;
onCollisionEnter(collision: Collision) {
    player.position = spawn.position;
}
Thanks for help anyway,  Very Happy

lol! <I am goku, check out this paper I put on my power pole, it says lol. Whats the foot thing, bulma? Did you step on my paper? wait is this food? Yucky it tastes like paper.
Back to top
Permissions in this forum:
You cannot reply to topics in this forum