- Home /
EventTrigger.OnDrag on worldspace canvas
Hello,
I'm trying to drag a UI button on a world space canvas (World space render mode - the canvas is not filling the entire screen) and I'm using the EventTrigger.OnDrag using the BaseEventData to get the delta movements. However, all the returned data are in ScreenSpace values (The delta movements and the drag position). Is there an easier way to get the world space data from the canvas, that I'm missing?
I know I can get these data with camera conversions but I'm asking if there is an easier way to do that.
Thanks
Answer by Mazer83 · Nov 01, 2017 at 07:39 PM
Use RectTransformUtility.ScreenPointToWorldPointInRectangle.
Your answer
Follow this Question
Related Questions
UI elements stop working based on hirarchy position 1 Answer
Button clickzone is only small area of the button 0 Answers
Android Touch Issue(2 buttons) 0 Answers
Eventsystem requires window focus? 0 Answers