Search Unity

Interacting with slider using gameobject

Discussion in 'Getting Started' started by t3i3n1, Nov 16, 2019.

  1. t3i3n1

    t3i3n1

    Joined:
    Jun 27, 2019
    Posts:
    2
    Hi, I want to know if it is possible to move the slider using a gameobject like a sphere. Normally you can move the slider using mouse drag, but I want to move a gameobject on top of the handle and be able to move the slider.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    How are you moving this GameObject then? You can modify the value of the slider in code, I believe by just setting the slider's "value" parameter, so that's likely to be the best approach.
     
  3. t3i3n1

    t3i3n1

    Joined:
    Jun 27, 2019
    Posts:
    2
    The GameObject will be moved by mouse. I am aware that changing the value will change the position of the handle. I want to know if it is possible to issue a 'mouse click' action by the GameObject instead of me clicking the mouse button.