Search Unity

UI Input with pointer - Buttons and Slider

Discussion in 'VR' started by FloAtm, Feb 26, 2019.

  1. FloAtm

    FloAtm

    Joined:
    Dec 3, 2018
    Posts:
    4
    Hey there,

    I'm currently at the verge of a breakdown. I spent hours building my own laser pointer, making it shoot raycasts on everything and try to make it work with my UI. But it won't. At least not correctly.

    What works: Raycast and draw line.

    Where I struggle. Right now I have two options.
    A) Standard UI button and cube without mesh renderer to it. This makes the button fade thru its animations according to its button script. BUT it won't resolve the On button click events! So I added an event trigger onto the button - which... will indeed trigger the "pointer enter" events! But not its "pointer click" events :(


    So what I thought: my click must be implemented wrong! To test this:
    B) Added an event trigger to the cube, that's the buttons collider. Set it to "pointer click". And tada! it works! BUUUUT this kills the animation of the button! Why?


    Can anyone help me? I'd also take new startpoints into consideration, if you have a good hint!



    Next issue are sliders. Any tipps on how to make them work?


    Thanks for any help!!

    Cheers
    Flo