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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to make a onscreen JoyStick that operates according to mouse inputsand movements?

Discussion in 'Getting Started' started by aksh2143, Oct 13, 2015.

?

How to make a onscreen JoyStick that operates according to mouse inputsand movements?

  1. Possible

    1 vote(s)
    100.0%
  2. NOtPossible

    0 vote(s)
    0.0%
Multiple votes are allowed.
  1. aksh2143

    aksh2143

    Joined:
    Jul 6, 2015
    Posts:
    10
    i am trying to make an onscreen joyStick. For that i searches many examples but they all were on input touches ans what i wanted was according to mouse position and inputs like i this image. Any one have code here? _/\_
     

    Attached Files:

  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,848
    Almost any of those onscreen virtual joysticks designed for touches ought to work with mouse movements as well. It's possible you may have to tweak the code a bit to make use of mouse events rather than touch events, but this is a fairly minor change.

    You don't see this much because it's a horrible UI. But it's entirely possible.
     
  3. aksh2143

    aksh2143

    Joined:
    Jul 6, 2015
    Posts:
    10
    So any reference from you (@JoeStrout ) ?