Not working when built

RistoPaasivirta

New member
I'm having a bit of a problem with the Behavior Designer samples.
They don't work in builds, while working fine inside Editor.

Here are the steps to reproduce the issue:

Create a HDRP project using Unity 6000.0.41f1
Import Behavior Tree PRO 2.0.2f1 and samples
Add Entities Graphics package
Change the samples materials' shaders to HDRP/Lit
Make a windows build with just the "Entities" sample scene
Nothing works

This also happens with my custom tasks.
Made a simple "constant rotation" task based on the ECS examples.
Added a tree that has only that task node, nothing else.
Works fine in editor.
But when trying to make IL2CPP build using the entities subscenes they don't work.
 
Last edited:
I looked into this and unfortunately it's related to an Entities issue. I just submitted the bug report and you can view the repro scene here:


You'll notice that in the editor this code works fine, but outputs null within the build. This is a very stripped down version of the issue that Behavior Designer is having.

ComponentTypes cannot be serialized, so the correct route is to use a stable hash. This stable hash must be used to convert an ulong into a ComponentType, but the method for conversion is returning null. As a result the baked behavior tree doesn't know which task to run because it uses these ComponentTypes in order to execute the task. I have also created a new thread to see if anybody else has run into this.

I will try to come up with a workaround until Unity fixes this bug, and will let you know as soon as I do.
 
Just giving you a heads up that I found a solution to this and the fix will be included in the next update. This next update should be released soon but if you need it sooner feel free to send me a message.
 
Back
Top