Possible World Position Bug

I just wanted to verify if this is a possible bug before reporting it via bug reporter.

I want to snap a particle system to the position of a visual element in Update().

mainCamera.ScreenToWorldPoint(visualElement.worldBound.center)

Using the above code doesn’t position the element correctly. It (the red square) is suppose to be in the center of the spinner (see image).

Am I doing something wrong or is this not possible yet?

Thanks!

6464719--725131--Screen Shot 2020-10-27 at 9.37.07 PM.png

Camera’s screen coordinate’s (0,0) position corresponds to the bottom-left corner, UIToolkit’s origin is top-left. you could try to inverse the value using Camera.pixelHeight or Screen.height

1 Like

Thanks! Works like a charm.