Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

how to take mouse input in ut?

Discussion in 'Project Tiny' started by apoorv_baked, Feb 1, 2019.

  1. apoorv_baked

    apoorv_baked

    Joined:
    Feb 1, 2019
    Posts:
    5
    i tried using "ut.Runtime.Input.getKeyDown(ut.Core2D.KeyCode.Mouse0)" in the if statement but this doesn't work but it does if I use "KeyCode.W" instead of "Mouse0" ,"Mouse1" ,"Mouse2" ,as you can see in the attached file ,the Console.log only shows output of W and not any other mouse button. Can someone help please.
     

    Attached Files:

  2. apoorv_baked

    apoorv_baked

    Joined:
    Feb 1, 2019
    Posts:
    5
    solved :
    I used "if (ut.Runtime.Input.getMouseButtonDown(0))" instead of "if(ut.Runtime.Input.getKeyDown(ut.Core2D.KeyCode.Mouse0))"
     
  3. Dunk86

    Dunk86

    Joined:
    May 10, 2015
    Posts:
    53
    As far as I'm aware, only button 0 works, ut.Core2D.Input.getMouseButtonDown(1) and ut.Core2D.Input.getMouseButtonDown(2) never return true for me.
    I wouldn't expect right click to work, but middle click would be useful for map scrolling (since you want to emulate touch scrolling)