Behavior Tree Vector3 Blackboard Value TryGet Causing Crash

I am having some issues getting the Blackboards working with Vector3. It seems that at first my editor was using System.Numerics Vector3, but when switching to FlaxEngine.Vector3 a crash occurs. I do not see a cause in the logs.

Here is the code that is causing the crash. Make a blackboard that contains a Vector3. Make a behavior tree that has a selector that uses this Vector3. My Blackboard looks like this:

public BehaviorKnowledgeSelector<Vector3> Position;

    public override void InitState(BehaviorUpdateContext context)
    {
        // Initialize state and assign it
        var state = new State
        {
            TargetPosition = Vector3.Zero
        };
        //THIS IS causing crash
        if (Position.TryGet(context.Knowledge, out var position))
            state.TargetPosition = position;

        NewState(context.Memory, state);
    }

The crash is reproduced in a fresh project as well. Project: Test_Behave_1.zip - Dysk Google

Thanks for reporting this. Fixed in Comparing 7c53b1e99ad1...0360f7786d65 · FlaxEngine/FlaxEngine · GitHub.

3 Likes

WTF? You are a god. I have a bug fixed in 2.5 hours here on what seems to be a near one man team and I have countless bugs reported in Unity - a billion dollar company with 1000s of employees that still haven’t been fixed in 5+ years.

I am seriously, so sad you didn’t exist when we started our project. I am able to do in hours what would normally take me days in Unity by just shear speed of this engine alone.

3 Likes