I would suggest going backwards makes more sense when pathfinding to endState.
https://github.com/sploreg/goap/blob/master/Assets/Standard%20Assets/Scripts/AI/GOAP/GoapPlanner.cs#L93
That way you give the AI a higher chance of finding a solution that works instead of a predefined set of actions that give you the result.
In other words, you should match endState with postEffects and the action's postEffects with next actions preConditions or existing startState.
endState -> postEffects -> preConditions/startState
Though you want to make sure to always check against the startState for every action because you could end the planning earlier since it might just be sufficient enough from where you are.
I would suggest going backwards makes more sense when pathfinding to endState.
https://github.com/sploreg/goap/blob/master/Assets/Standard%20Assets/Scripts/AI/GOAP/GoapPlanner.cs#L93
That way you give the AI a higher chance of finding a solution that works instead of a predefined set of actions that give you the result.
In other words, you should match
endStatewithpostEffectsand the action'spostEffectswith next actionspreConditionsor existingstartState.endState->postEffects->preConditions/startStateThough you want to make sure to always check against the
startStatefor every action because you could end the planning earlier since it might just be sufficient enough from where you are.