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

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » General Dicussions » Request » Unity Scene turns dark after reloading level during runtime.

Unity Scene turns dark after reloading level during runtime.

View previous topic View next topic Go down  Message [Page 1 of 1]

Zachvlol


Member [Lv. 3]
Member [Lv. 3]

this video explains my problem.
Please help.

View user profile

SpaceKryptonite


Member [Lv. 3]
Member [Lv. 3]
Is there any script that involves affecting the light?

View user profile http://vgbam.com/

BryceCain25


SUPER MODERATOR
SUPER MODERATOR
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
=)

View user profile

Zachvlol


Member [Lv. 3]
Member [Lv. 3]
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...

View user profile

BryceCain25


SUPER MODERATOR
SUPER MODERATOR
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!

View user profile

Zachvlol


Member [Lv. 3]
Member [Lv. 3]
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?

View user profile

BryceCain25


SUPER MODERATOR
SUPER MODERATOR
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

View user profile

Zachvlol


Member [Lv. 3]
Member [Lv. 3]
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.

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum