Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question SendValueToControl only works when the object is Acitve

Discussion in 'Input System' started by qiqiqi, Feb 8, 2021.

  1. qiqiqi

    qiqiqi

    Joined:
    Nov 3, 2015
    Posts:
    16
    Hi,
    I have a virtual button UI, when pointer enter the UI I want it SendValueToControl(1) and deactive itself, the I need to reset(send 0) it at some point while the UI is deactive, but it doesn't work

    It is annoying to do things like

    ui.gameObject.SetActive(true);
    ui.Reset();
    ui.gamObject.SetActive(false);


    so any workaround? or did I miss anything about OnScreenControl?
     
  2. dreamCirno

    dreamCirno

    Joined:
    May 16, 2018
    Posts:
    20