Hi,
You can try using attached code for the action to perform:
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Vector3)]
[Tooltip("Performs projection of a vector on a plane using its normal.")]
public class Vector3ProjectOnPlane : FsmStateAction
{
[RequiredField]
public FsmVector3 vector;
[RequiredField]
public FsmVector3 planeNormal;
[UIHint(UIHint.Variable)]
public FsmVector3 storeVector3Result;
public bool everyFrame;
public override void Reset()
{
vector = null;
planeNormal = null;
storeVector3Result = null;
everyFrame = false;
}
public override void OnEnter()
{
DoProjectOnPlane();
if (!everyFrame)
{
Finish();
}
}
public override void OnUpdate()
{
DoProjectOnPlane();
}
void DoProjectOnPlane()
{
storeVector3Result.Value = Vector3.ProjectOnPlane(vector.Value, planeNormal.Value);
}
}
}
Cheers!