From what I can see, you are invoking the method in OnEnter, which launches when the state goes active. Also, you are constantly invoking the method in the OnUpdate.
OnUpdate should only be triggered if the bool is true, otherwise, do the OnEnter, and then finish it.
Also, you can set bool to be false by default.
See if this works, I've not tested this.
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Material)]
[Tooltip("Get pixel color from a readable texture from a normalized vector2 position")]
public class Texture2DGetPixel : FsmStateAction
{
[ActionSection("Input")]
public FsmTexture SampledTexture;
[ActionSection("Position")]
[Tooltip("The floats to get the normalized position from, from 0 to 1")]
public FsmFloat xPos;
public FsmFloat yPos;
[ActionSection("Result")]
[Tooltip("Store the sampled color in a Color variable.")]
public FsmColor StoredColor;
[Tooltip("Repeat every frame while the state is active.")]
public FsmBool everyFrame;
public override void Reset()
{
SampledTexture = null;
xPos = null;
yPos = null;
everyFrame = null;
}
public override void OnEnter()
{
DoGetPixelCOlor();
Finish();
}
public override void OnUpdate()
{
if(everyFrame.Value) {
DoGetPixelCOlor();
}
}
void DoGetPixelCOlor()
{
if (SampledTexture == null) return;
{
Texture2D SourceTexture = SampledTexture.Value as Texture2D;
int x = Mathf.FloorToInt (xPos.Value * SourceTexture.width);
int y = Mathf.FloorToInt (yPos.Value * SourceTexture.height);
Color StoredColor = SourceTexture.GetPixel (x, y);
}
}
}
}