
0
Fixed
Null Unity objects cause error when value prediction is enabled
I was doing more experimenting with variables that are defined in script, and everything seems fine until you use a GameObject, at which point Bolt goes into an infinite log error loop and also shows visual glitches.
Despite the bugging out, everything still acts as expected if you ignore the error spam and click play.
In the below image, the bug would occur the moment you hook "someObject" to the Get Name or Debug command, even though, as you can see in the log, it still runs fine if you ignore it.
sample code:
public class SomeClass : MonoBehaviour { public int? someInt = null; public string someString = null; public GameObject someObject; void Start () { someInt = 4; someString = FindObjectOfType<someobject>().gameObject.name; someObject = FindObjectOfType<someobject>().gameObject; } }
Note: I forced nulls just to double check.
Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
Customer support service by UserEcho
Hey,
I'm unable to reproduce this bug. Please paste the stack trace when you mention errors. What exact errors do you get when you connect the ports? Do you only get it in play mode or in edit mode as well?
Only in edit mode, only when viewing the specific flow graph. In play mode, it appears the null GameObject gets immediately replaced with the target and no errors occur. I'll update this post with more info when I get back to my work computer tomorrow, hopefully it's just something simple on my end.
Edit: So I made a new project with a fresh install of bolt 1.0.1 (from the asset store), no changes to anything except I chose programmer names. Setup a simple scene and everything seemed fine, hit play and worked as expected, hit stop and went back to the graph window, opened the flow machine and immediately got the infinite spam problem again.
heres the scene in its entirety. The moment I connect the nodes I get the spam. As you can see in the log, it works fine, beyond the annoying errors.
Two scripts in the scene, a blank MonoBehavior (SomeOtherObject) on the object to reference(GameObjectToFind), and this TestScript on the FSM object:
Hm, that's a very weird error (Unity should just return null and not throw an exception), but for now to avoid it you can uncheck the Values toggle in the toolbar. I'll look into it for v.1.0.2.
The values trick is a nice workaround, thanks!