getting error Ambiguity between 'IntSubtract.intVariable' and 'IntSubtract.intVariable for 9 scripts

using UnityEngine;

namespace HutongGames.PlayMaker.Actions
{
[ActionCategory(ActionCategory.Math)]
[Tooltip(“Subtracts a value to an Integer Variable.”)]
public class IntSubtract : FsmStateAction
{
[RequiredField]
[UIHint(UIHint.Variable)]
[Tooltip(“The int variable to subtract from.”)]
public FsmInt intVariable;

[RequiredField]
[Tooltip(“Value to subtract from the int variable.”)]
public FsmInt subtract;

[Tooltip(“Repeat every frame while the state is active.”)]
public bool everyFrame;

[Tooltip(“Used with Every Frame. Subtracts the value over one second to make the operation frame rate independent.”)]
public bool perSecond;

float _acc = 0f;

public override void Reset()
{
intVariable = null;
subtract = null;
everyFrame = false;
perSecond = false;
}

public override void OnEnter()
{
doSubtract();

if (!everyFrame)
Finish();
}

public override void OnUpdate()
{
doSubtract();

}

void doSubtract()
{
if (perSecond)
{
int _absSub = Mathf.Abs(subtract.Value);
_acc += ( _absSub* Time.deltaTime);
if (_acc>=_absSub)
{
_acc = 0f;
intVariable.Value -= subtract.Value;
}
}else{
intVariable.Value -= subtract.Value;
}
}
}
}

Please edit to use code-tags . If you have errors, post the full error which also includes line numbers (etc) otherwise you’re asking devs to figure out what the compiler knows.

I would suggest though that you ask on the Playmaker forum instead because this is a 3rd-party product.

Thanks.

1 Like

how? im sorry but im new and dont know what code-tags are

These things here:

8904108--1218573--upload_2023-3-26_8-15-17.png

The first one opens a dialog to paste code into.

int x = 1337;
return 451;

The second one is for inline code, like this.

1 Like

Try clicking on the link I provided.

1 Like