Question by
money4honey · Nov 16, 2016 at 03:27 PM ·
vector3mouseeventshandles
Move object in Scene view using mouse delta
I trying move arrow in scene view using mouse events and mouse delta. my code:
case EventType.MouseDrag:
if (GUIUtility.hotControl == controlID && e.button == 0)
{
var offset = new Vector3(e.delta.x, e.delta.y, 0) * (distanceFromCamera / 300);
arrow.Start = arrow.Start - offset;
arrow.End = arrow.End - offset;
GUI.changed = true;
e.Use();
}
break;
it works, but in this case arrow moves only in two dimensions. i'm don't have deep understanding how use vectors and coordinates system, so i need any help.
screen-1.png
(60.3 kB)
Comment