FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.

Share

descriptionUnity Scene turns dark after reloading level during runtime.

more_horiz

this video explains my problem.
Please help.

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

more_horiz
Is there any script that involves affecting the light?

_________________
I am Space! Bring Cookies, and I will bring Joy! Razz

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

more_horiz
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
=)

_________________
-BryceCain25

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

more_horiz
@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...

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

more_horiz
@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!

_________________
-BryceCain25

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

more_horiz
@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?

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

more_horiz
@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

_________________
-BryceCain25

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

more_horiz
@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.
Permissions in this forum:
You cannot reply to topics in this forum