Click or Drag but not both
How can i proof if the left button just got clicked (for rotating) or it's dragged, for for dragging around?
My problem is , the rotation always happends when i drag.
For the rotation i use a coroutine and for dragging i use a raycast and OnMouse Down() OnDrag() and OnMouseUp()
Comment
Best Answer
Answer by Statement · Oct 24, 2015 at 11:26 AM
Set a bool to keep track of if you're dragging.
bool isDragging;
void OnMouseDown()
{
isDragging = false;
}
void OnMouseDrag()
{
isDragging = true;
}
void OnMouseUp()
{
if (isDragging)
{
}
else
{
}
}