Hi, I’m using a ‘Set Variable Value’ Action to change an Enum on the Blackboard when my script returns Status.Success and all runs fine, but instead of manually changing the Value in the dropdown window is there a way to change it in the script before Status.Success is called?
I did make an Action script to try and change it, then call this when Status.Success instead of the Set Variable Value Action -
[SerializeReference] public BlackboardVariable<ZombieState> Enum;
[SerializeReference] public BlackboardVariable<int> EnumValue;
protected override Status OnStart()
{
EnumValue.Value = 2;
if (Enum == null || EnumValue == null)
{
return Status.Failure;
}
Enum.ObjectValue = EnumValue.ObjectValue;
return Status.Success;
}
No errors, debugged it, it runs but it doesn’t change the value and switch to another state, I think I know the line 'Enum.ObjectValue = EnumValue.ObjectValue; ’ is the problem, or can’t it be done in an Action script? Any help would be gratefully appreciated, thanks.