Search Unity

Question EnhancedTouch detected also outside Game view

Discussion in 'Input System' started by Kubinna, Apr 13, 2023.

  1. Kubinna

    Kubinna

    Joined:
    Apr 19, 2015
    Posts:
    18
    Hello,

    I am using new Input system and EnhancedTouch. I am registering events in OnEnable function:
    Code (CSharp):
    1.     private void OnEnable()
    2.     {
    3.         EnhancedTouchSupport.Enable();
    4.         ETouch.Touch.onFingerDown += HandleFingerDown;
    5.         ETouch.Touch.onFingerUp += HandleLoseFinger;
    6.         ETouch.Touch.onFingerMove += HandleFingerMove;
    7.     }
    Everything is working fine, but main problem is, that touches are detected also outside of Game view. Is there any possibility to restricted it to Game view only?

    It is right way to detect fingerUp, fingerDown, fingerMove events? Or is only way to detect them inside Update function? Thank you! :)