Issue when loading a game
Posted: Mon Feb 06, 2023 6:41 pm
Hello everyone.
I'm have an issue when i load a saved game here is a video of the issue.
What happens is that, after saving then restarting unity and loading the game, the scene changes to day time, and that should not happen. I don't know where if the issue is with the save system(i'm using the save system that comes with the DS) on how it load the game. Each scene in the game has a manager that activates o deactivates the light and other game objects. it acces the variable "Dormir" that is used to set the scene to night.
So far i have tried to change the code to Awake and modifying the script execution order with out any fix. So i'm really stuck with this problem.
Here's part of the Scene Manager Code that controlls the lights
I'm have an issue when i load a saved game here is a video of the issue.
What happens is that, after saving then restarting unity and loading the game, the scene changes to day time, and that should not happen. I don't know where if the issue is with the save system(i'm using the save system that comes with the DS) on how it load the game. Each scene in the game has a manager that activates o deactivates the light and other game objects. it acces the variable "Dormir" that is used to set the scene to night.
So far i have tried to change the code to Awake and modifying the script execution order with out any fix. So i'm really stuck with this problem.
Here's part of the Scene Manager Code that controlls the lights
Code: Select all
private void Start()
{
if(DialogueLua.GetVariable("Dormir").asBool)
{
if(DirectionalLight != null)
{
DirectionalLight.SetActive(false);
}
if(lights != null)
{
foreach (var light in lights)
{
light.SetActive(true);
}
}
}
}