Hi,
I have a custom action that its meant to throw errors and stop the flow of playmaker when certain conditions arise.
The problem is that if everyframe is not checked the error only is passed to the console and playmaker keeps working.
But if everyframe is checked playmaker stops and the error shows in the playmaker state editor along with showing in the console, this is the behaviour I want.
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory("Gamecreator Variables")]
public class testt : FsmStateAction
{
[Tooltip("Copy the variable every frame - MIGHT AFFECT PERFORMANCE")]
public bool EveryFrame;
// Code that runs on entering the state.
public override void OnEnter()
{
getVar();
if (!EveryFrame)
{
Finish();
}
}
// Code that runs every frame.
public override void OnUpdate()
{
getVar();
}
public void getVar()
{
LogError("error");
}
}
}
any idea on how to make it work when everyframe is not checked?
Thanks in advance