Hi everyone.
First of all, Im trying to start with new input system and it really looks great for me, so thanks for Your hard work!
I stuck with assigment of two interactions to one button, at the moment all .performed action works, but .canceled action seems to work only for PressInteraction, for HoldInteraction its never called. I mean for just click I got .canceled called but if hold button longer i wont get any .canceled called after relase.
I can add just relase button action to find when hold is canceled but it seems like not proper solution.
Iv readed thread :
And Rene-Damm posted code with assigment to canceled in HoldInteraction, so it should work and I have no idea what I missed.
Thanks for any help
Input actions set like in attachment (just add Navigation to Player in Unity generated asset).
private void Awake()
{
inputControll = new Test();
inputControll.Enable();
inputControll.Player.Navigation.performed +=
ctx =>
{
NavigationCanceled(ctx.ReadValue<float>());
if (ctx.interaction is PressInteraction)
SetNavigationPoint(ctx.ReadValue<float>());
if (ctx.interaction is HoldInteraction)
FollowPointer(ctx.ReadValue<float>());
};
inputControll.Player.Navigation.canceled +=
ctx =>
{
if (ctx.interaction is PressInteraction)
NavigationCanceled(ctx.ReadValue<float>());
if (ctx.interaction is HoldInteraction)
FollowCanceled(ctx.ReadValue<float>());
};
}
I found solution: https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/Interactions.html#default-interaction
Mean it work like it should work and I just need some flag to set if follow started and turn it off when button is relased, or try to write custom interaction.