0
Fixed

Boolean Local Variable won't load on start

Janus 5 months ago in Game Creator updated by Marti (Lead Developer) 5 months ago 5

Got an issue with this boolean not being recognised on starting the game. Wasn't a problem until the last update.

Unity version:
2019.1.7f1
Game Creator version:
1.0.1

Answer

Answer

Hi Janus. Took a while, but I think I know where the problem is. First of all, the first console log that says "Set Visibility" is a log that shouldn't be there, and I'll make sure to remove it on the next update :-)

Secondly, the name of the variable is RainOn/Off. Local Variable names use the reserved character "/" to access nested variables. For example, if you have a Game Object variable called A that points to an object with another Local Variable called B, you can access B by accessing the variable name: A/B (like if they where folders).

So the solution would be to change the name of the variable to something like Rain-On-Off. I'll make sure to forbid adding this character on the next update!

Started

Hi Janus. Sorry for the late reply, I was in Unite Copenhagen and had very little time. Could you click on the error at the bottom of the screen and send the entire stack-trace message? When you select it, it's the error that appears as a second section in the Console. Thanks!

Hi Marti, hope Unite Copenhagen was successful for you :)

Setting visibility: False
UnityEngine.Debug:Log(Object)
GameCreator.Characters.CharacterAnimator:SetVisibility(Boolean) (at Assets/Plugins/GameCreator/Characters/Mono/Characters/CharacterAnimator.cs:402)
GameCreator.Camera.CameraMotorTypeFirstPerson:EnableMotor() (at Assets/Plugins/GameCreator/Camera/Motors/CameraMotorTypeFirstPerson.cs:74)
GameCreator.Camera.CameraController:Start() (at Assets/Plugins/GameCreator/Camera/Mono/CameraController.cs:70)

and

NullReferenceException: Object reference not set to an instance of an object
GameCreator.Core.ConditionVariableBool.Compare (UnityEngine.GameObject target) (at Assets/Plugins/GameCreator/Variables/Mono/Conditions/ConditionVariableBool.cs:24)
GameCreator.Core.ConditionVariable.Check (UnityEngine.GameObject target) (at Assets/Plugins/GameCreator/Variables/Mono/Conditions/ConditionVariable.cs:32)
GameCreator.Core.ICondition.Check (UnityEngine.GameObject target, System.Object[] parameters) (at Assets/Plugins/GameCreator/Core/ScriptableObjects/Interaction/ICondition.cs:25)
GameCreator.Core.IConditionsList.Check (UnityEngine.GameObject invoker, System.Object[] parameters) (at Assets/Plugins/GameCreator/Core/ScriptableObjects/Interaction/IConditionsList.cs:63)
GameCreator.Core.Clause.CheckConditions (UnityEngine.GameObject target, System.Object[] parameters) (at Assets/Plugins/GameCreator/Core/ScriptableObjects/Interaction/Clause.cs:60)
GameCreator.Core.Conditions.Interact (UnityEngine.GameObject target, System.Object[] parameters) (at Assets/Plugins/GameCreator/Core/Mono/Interaction/Conditions.cs:35)
GameCreator.Core.Trigger.Execute (UnityEngine.GameObject target, System.Object[] parameters) (at Assets/Plugins/GameCreator/Core/Mono/Interaction/Trigger.cs:214)
GameCreator.Core.Igniter.ExecuteTrigger (UnityEngine.GameObject target, System.Object[] parameters) (at Assets/Plugins/GameCreator/Core/Mono/Igniters/Igniter.cs:64)
GameCreator.Core.Igniter.ExecuteTrigger (UnityEngine.GameObject target) (at Assets/Plugins/GameCreator/Core/Mono/Igniters/Igniter.cs:57)
GameCreator.Core.IgniterPlayerEnter.OnTriggerEnter (UnityEngine.Collider c) (at Assets/Plugins/GameCreator/Core/Mono/Igniters/IgniterPlayerEnter.cs:21)

Answer

Hi Janus. Took a while, but I think I know where the problem is. First of all, the first console log that says "Set Visibility" is a log that shouldn't be there, and I'll make sure to remove it on the next update :-)

Secondly, the name of the variable is RainOn/Off. Local Variable names use the reserved character "/" to access nested variables. For example, if you have a Game Object variable called A that points to an object with another Local Variable called B, you can access B by accessing the variable name: A/B (like if they where folders).

So the solution would be to change the name of the variable to something like Rain-On-Off. I'll make sure to forbid adding this character on the next update!

+1

That fixed it! Thanks :) Now I can go back to figuring out that soda machine :P

Fixed

Awesome! :-D I'm currently fixing this, so I'm marking this ticket as fixed. Starting in version 1.0.2, you won't be able to use the "/" character in Local and Global variable names.