KeiKei
edited February 2015 in ORK Support
I have a small problem with my game, intended to be controlled by the mouse only, so click to move, interact, etc.

Basically whenever I click on a button in the UI, the player moves where I clicked, even though player movement is off in that event.

Is there some way to resolve this?
Post edited by Kei on
  • edited February 2015
    I set the "Allow activation On Mobile dence" to true, can disable player movement, I just know UGUI.

    image


    if (Input.GetMouseButtonDown(0))
    {
    if (EventSystem.current.IsPointerOverGameObject())
    {
    Debug.Log("Click on UI");
    return;
    }
    else
    {
    Debug.Log("Click don't on UI");
    }
    }
    Post edited by ZhaoYu on
  • That totally worked! Thank you very much =)
  • Are you using custom controls? If so, you need to register them to ORK to allow enabling/disabling it when blocking player controls.

    Also, there's a convenient way to check if a the mouse is over a GUI created by ORK:

    ORK.GUI.CheckClick(ORK.Control.MousePosition)

    Returns true if the mouse position is over a GUI (e.g. dialogue, HUD, etc.).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Sign In or Register to comment.