Difference between tap and swipe.

Hey everyone
My class makes a school project for some kind of climate contest and I have to code a Game/App for that. We have a globe wich you can turn by swiping your finger ( around y and x axis). This is my code for that:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Swipe : MonoBehaviour
{
    float rotSpeed = 40;
    public GameObject Earth;  //Parent object because I have the continents seperatly
    void OnMouseDrag()
    {
        float rotX = Input.GetAxis("Mouse X")*rotSpeed*Mathf.Deg2Rad;
        float rotY = Input.GetAxis("Mouse Y")*rotSpeed*Mathf.Deg2Rad;

        Earth.transform.Rotate(Vector3.up, -rotX,  Space.World);
        Earth.transform.Rotate(Vector3.right, rotY, Space.World);


    }
    
}

This works fine, but now you I have to code that you can click on a continent. I think my class wants to fill in the CO² usage of this continent. For that, I have this code:

using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class Tap : MonoBehaviour
    {
    	public GameObject Text;
    	int counter = 0;
    	void OnMouseOver() {
        	if(Input.GetMouseButtonDown(0)) {
        		counter++;
        		if (counter % 2 == 1){
        			Text.SetActive(true);
    			} else {
    				Text.SetActive(false)
    			}
        	}
        }
    
    }

I will work on cool animations later, but now I will come to the point: The continent will also get clicked, if you want to swipe and start on the continent (I new that when I wrote the code but I didn`t have a better option). I know there are some other questions about it but I want to have a solution especially for that.
Thank you very much for helping me!
Here is a photo for you:

Hello @Mu_Q-Code, To make the difference between a drag and a tap you need to compare distance.
Register when the player click thats postion1, Wait one frame and register mouse position, thats position2. Now compare the distance (Vector2.Distance(position1, position2)) with a thresold you define.

If the distance is greater than the thresold so its a swipe else its a tap.

Hope that help you,

Raph

Hey @RadonRaph
Thanks for the quick answer! Thats a really good idea. Does Unity have some sort of WaitForFrame Function and how do I implement that? Thanks,
Mu_Q-Coder

I am curious too how to implement differ the dragging over an map from clicking an object in that world. Cannot find any solution, it is too complicated for an artist and non coder. Some help how to setup this code would be of great help.