Hi,
yes, by all means, if you can code a custom action, this is the best way, I do that always on such cases. PlayMaker general actions can not be that specific, because each behavior is unique.
I did create a while ago a sendmessage that would allow a vector3 to be passed back. The good thing about FsmVariables is that it's quite easy actually, BUT it means that the method you call implements the proper signature.
// (c) Copyright HutongGames, LLC 2010-2011. All rights reserved.
using UnityEngine;
namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.ScriptControl)]
[Tooltip("Sends a Message to a Game Object with a specific variable holding reference to a fsmVector3. See Unity SendMessage docs.")]
public class SendMessageVector3Out : FsmStateAction
{
[RequiredField]
public FsmOwnerDefault gameObject;
public SendMessageOptions options;
[RequiredField]
public string functionName;
[UIHint(UIHint.Variable)]
public FsmVector3 outVector3;
public override void Reset()
{
gameObject = null;
options = SendMessageOptions.DontRequireReceiver;
functionName = "";
}
public override void OnEnter()
{
if (gameObject.OwnerOption == OwnerDefaultOption.UseOwner)
DoSendMessage(Owner);
else
DoSendMessage(gameObject.GameObject.Value);
Finish();
}
void DoSendMessage(GameObject go)
{
go.SendMessage(functionName,outVector3,options);
return;
}
}
}
bye,
Jean