Hi everyone
I want to say I have a problem and I don’t know how to fix it.
I created a button and when it’s clicked, I want it to wait 1 second before doing other stuff it should. When button is clicking, it’s not waiting.
This is the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ClickAndWait : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnMouseDown()
{
System.Threading.Thread.Sleep(1000);
}
}
Please note it’s my first time experience with Unity and C#. To this, I’ve added ‘Add to list Click On’ thing and there is script, but I don’t know what to do more to make this work. It’s my second day fixing it and still nothing.
Thanks ![]()
