What i try:
private void OnControllerColliderHit(ControllerColliderHit hit)
{
if (hit.gameObject.tag == "obstacle")
{
int lastRunScore = int.Parse(scoreScript.scoreText.text.ToString());
PlayerPrefs.SetInt("lastRunScore", lastRunScore);
anim.SetTrigger("isFall");
speed = 0;
UseDelay();
losePanel.SetActive(true);
PauseButton.interactable = false;
}
}
async Task UseDelay()
{
await Task.Delay(3000);
}
But nothing happen and I received such a warning
Assets\My new scripts\PlayerController.cs(171,13): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the cal
Thanks in advance