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. Dismiss Notice

Rotated elements and Mouse Events

Discussion in 'UI Toolkit' started by Knosis_Co-Verse, Apr 24, 2021.

  1. Knosis_Co-Verse

    Knosis_Co-Verse

    Joined:
    Apr 23, 2019
    Posts:
    12
    I'm trying to use rotated sliders, but their mouse events detection get messed up especially on its extremities.
    Other than that, they work surprising well. But if i can't find a way to solve it, I'm gonna need to create my own collision detection which I'm not looking forward to.

    I'm rotating it using VisualElement.transform.rotation.
     
    Last edited: Apr 24, 2021
  2. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    515
    What version of unity/the package are you using? Before 2021.2, the only rotation supported by transform.rotation are axis aligned (90, 180, etc) because the bounding box calculation are limited in this regard.

    This is an area currently under work and as of 2021.2.0a14 it should work.
     
  3. Knosis_Co-Verse

    Knosis_Co-Verse

    Joined:
    Apr 23, 2019
    Posts:
    12
    I'm using 2021.1. Good to hear that you guys are working on it tho. Thanks for the reply.