Global Variables are being Removed / Deleted when entering Playmode

johnrL

New member
Hello,

I am using the latest source version and Unity 2020.1.17 and when I enter play mode my global variable are being removed or deleted. I'm also getting error in the console when re-adding it back. See image below. Not sure if this is a bug or just me doing something wrong.

Thanks,

John L


BD Error.png
 
Hello,

I made a video. The steps to reproduce:

  1. New project (Unity 2020.1.17f1)
  2. Import current source for BH
  3. Create BH Tree
  4. Open global variables tab
  5. Add example "StartUnloading" bool to list.
  6. Error message and variable not added
Also, the issue happens in Unity 2020.3.2f.

Video link:

Thanks,
John
 
Last edited:
Thank you for the steps! This looks like it was a problem with an optimization from the last update. I have released a new version of BD as well as uploaded a new source which fixes this. Thanks again for the report!
 
Hello, unfortunately I am getting this same error, using a version of BD downloaded last week. The steps to reproduce are the same.

Edit: I should add that this only happens the first time entering into play mode when Unity is started, subsequent plays do not remove global variable references.
 
I am not able to reproduce it in the current version - make sure the version that you are using says version 1.7.1 in the welcome screen.
 
Unfortunately I am on 1.7.1. Will I lose my behavior trees if I delete the folder and reimport the package?

1631657237351.png
 
No, you won't. Just make sure you haven't stored any external trees in the Behavior Designer folder. If you still get the error can you list the steps to reproduce from a fresh project? Also, what serialization are you using?
 
Hello, I reimported the files and tried both JSON and Binary serializations without luck. I did realize however that this issue only occurs when the global variable is set to scene-specific game objects. It works fine with prefabs. Is this the expected behavior?
 
Top