Hi.
You can use both, many cases you would want to check the bool but also many cases you would want to trigger an event.
Here is a sample script which i use on a scriptable object :
// (c) Copyright JinxterGames, LLC 2010-2022. All rights reserved.
// Made by djaydino -- http://www.jinxtergames.com/ --
using UnityEngine;
using JinxterGames.Darklight;
using JinxterGames.Darklight.ScriptableObjects;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("Scriptable Objects/Stats")]
[Tooltip("")]
public class So_StatsGetLocationsSeen : FsmStateAction
{
[RequiredField]
public StatsDefaultNew statsDefaultNew;
[RequiredField]
[UIHint(UIHint.FsmString)]
public FsmString reference;
[ActionSection("Result")]
[UIHint(UIHint.Variable)]
public FsmBool seen;
[ActionSection("Events")]
[Tooltip("Event to send if the Bool variable is True.")]
public FsmEvent isTrue;
[Tooltip("Event to send if the Bool variable is False.")]
public FsmEvent isFalse;
private int index;
public bool everyFrame;
public override void Reset()
{
statsDefaultNew = null;
seen = new FsmBool { UseVariable = true };
isTrue = null;
isFalse = null;
}
public override void OnEnter()
{
index = ((int)statsDefaultNew.locationsSeenName.FindIndex(a => a.Equals(reference.Value)));
DoCheck();
if (!everyFrame) Finish();
}
void DoCheck()
{
if (index > -1)
{
if (!seen.IsNone) seen.Value = statsDefaultNew.locationsSeen[index];
Fsm.Event(statsDefaultNew.locationsSeen[index] ? isTrue : isFalse);
}
else
{
#if UNITY_EDITOR
Debug.LogError("Reference NOT FOUND : " + reference.Value + " / Fsm Name : " + Fsm.Name + " / State : " + Fsm.ActiveStateName, Fsm.Owner);
#endif
}
}
}
}
these are the important parts :
public override void Reset()
{
seen = new FsmBool { UseVariable = true };
}
void DoCheck()
{
if (!seen.IsNone) seen.Value = statsDefaultNew.locationsSeen[index];
Fsm.Event(statsDefaultNew.locationsSeen[index] ? isTrue : isFalse);
}
the "UseVariable = true" will set the variable to none by default.