In a custom SequenceAction I need to get a pawn from a linked object:
And sometimes it doesn't work, I get in the log :
"ScriptLog: Bad instigator for FortStandardAction :UTPlayerController_2"
But it was a controller, is my code above wrong ?
Code:
event Activated()
{
local FortStandard F;
local SequenceVariable S;
local Pawn P;
local Object instig;
instig=SeqVar_Object(VariableLinks[1].LinkedVariables[0]).GetObjectValue();
if (instig.IsA('Pawn'))
{
P=Pawn(instig);
}
if (instig.IsA('Controller'))
{
P=Controller(instig).Pawn;
}
if (P==none)
{
`log("Bad instigator for FortStandardAction :"$instig);
}
"ScriptLog: Bad instigator for FortStandardAction :UTPlayerController_2"
But it was a controller, is my code above wrong ?