AI Planner 0.3.0-preview.3 - Unable to add RewardModifier

Hello there,

I’m learning the AI Planner package and following some tutorials.

However, I can’t add new RewardModifiers to the list.

The builtin asset is not compiling the LocationDistance, for example.

But it works in the Tactics example…

Using Unity 2020.2.6f1 and Entities 0.17.0-preview.41.

Also upgraded the Tactics example with the same versions and it still works there.

Anyone knows what the problem may be?

Thanks!

After creating an empty problem definition, building the planner and reimporting all the problem went away…

The problem happened again, and when trying to build, this was the error message:

Seems like the code was not generated correctly:

namespace Generated.AI.Planner.StateRepresentation
{
    [Serializable]
    public struct Location : ITrait, IBufferElementData, IEquatable<Location>
    {
        public const string FieldPosition = "Position";
        public const string FieldForward = "Forward";
        public const string FieldTransform = "Transform";
        public Unity.Mathematics.float3 Position;
        public Unity.Mathematics.float3 Forward;
        public  Transform;
        ...
}

Changing to public Transform Transform; made it work again, but only after setting the AI Planner as embedded package and reimporting all.

Not satisfied, because I was certain it was working when installed from the registry, I’ve removed the embedded package and reinstalled from the registry, deleted all the generated assets and cache, reimported all, reopened Unity, and it worked again.

The same issue for me, I have compilation errors while using 0.3.0-preview.3:

Temp/PlannerAssembly/Generated.AI.Planner.StateRepresentation/Traits/Location.cs(18,26): error CS1519: Invalid token ';' in class, struct, or interface member declaration
UnityEditor.EditorApplication:Internal_PlayModeStateChanged (UnityEditor.PlayModeStateChange)

Temp/PlannerAssembly/Generated.AI.Planner.StateRepresentation/Traits/Location.cs(31,34): error CS1525: Invalid expression term ')'
UnityEditor.EditorApplication:Internal_PlayModeStateChanged (UnityEditor.PlayModeStateChange)

Temp/PlannerAssembly/Generated.AI.Planner.StateRepresentation/Traits/Location.cs(31,35): error CS1002: ; expected
UnityEditor.EditorApplication:Internal_PlayModeStateChanged (UnityEditor.PlayModeStateChange)