Bug: GoapSetBehaviour reference in AgentBehaviour component is set the same for all agents on scene start when there are multiple GoapSetBehaviour in the scene #153
There is a Game object (GO1) with GoapRunnerBehaviour component. No fields are assigned.
There is a GO2 with GoapSetBehaviour component. Config references "MeleeAgentSet". Runner references the GO1
There is GO3 with GoapSetBehaviour component. It references "RangedAgentSet" as config and the same runner from GO1.
What happens is that all AgentBehaviour components that are attached to my NPCs receive the GoapSetBehaviour component from GO3 when the scene is loaded, no matter what I configure with references in serialized field Goap Set Behaviour. If I disable GO3 and load the scene, the melee agents have the melee sets as it is setup in the editor. My workaround is setting the desired behaviour sets by script.
Expected behavior
The references to GoapSetBehaviour that are configured for AgentBehaviour in the scene do not get scrambled when I enter play mode.
@crashkonijn reached out to me and it turned out that a line in my project was assigning the field to all NPC controllers in Awake(). The library works perfectly well :)
Describe the bug I have the following setup:
What happens is that all AgentBehaviour components that are attached to my NPCs receive the GoapSetBehaviour component from GO3 when the scene is loaded, no matter what I configure with references in serialized field
Goap Set Behaviour
. If I disable GO3 and load the scene, the melee agents have the melee sets as it is setup in the editor. My workaround is setting the desired behaviour sets by script.Expected behavior The references to GoapSetBehaviour that are configured for AgentBehaviour in the scene do not get scrambled when I enter play mode.
Unity Version 2022.3.2f1
Unity.Collections Version 1.2.4
Package Version 2.1.19