#title = Drag_Gizmo_Path
#info = Insert an object by dragging the Gizmo 
#icon = gizmoLast.png

var()
{
 selected
 lastIstance
 istance
 pickedx
 pickedy
 pickedz
 
 field = "ENTITY"
}

input()
{
 fieldI = [field of istance]
}

onButtonClick()
{
 selected = onButtonClick.getType()
}

onGizmoMove()
{
 scene.deselectAll()
 istance = scene.createIstance(selected,lastIstance|scene.getRoot())
 pickedx = onGizmoMove.getX()
 pickedy = onGizmoMove.getY()
 pickedz = onGizmoMove.getZ()
 scene.setPosition(istance,pickedx,pickedy,pickedz)
 lastIstance = scene.getField(istance,"ENTITY")
 scene.selectIstance(istance)
}


