- Home /
Question by
TadeuszSynZygmunta · Jul 25, 2015 at 07:42 PM ·
mouseeditor-scriptingmouseposition
How to translate Event.current.delta to world position?
I make editor script and i want to manipulate verticles in mesh simply by dragging them with mouse. I'm using Event.current.delta to move verticles with mouse. It works but it moves the vertices too slow or too fast in relation to the mouse depending on the zoom in the editor.
Event e = Event.current;
if (e.type == EventType.MouseDrag)
{
object.position.x += e.delta.x;
object.position.y += e.delta.y;
}
I guess that the delta is in screen coordinates, but I can't not translate it to world coordinates. Camera.current.ScreenToWorldPoint(e.delta) gives me very large values.
Comment