when i press space my first if function works but my second if function also executes but why.
how do i make so that only the first if function work but the second doesnt
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Inputtest : MonoBehaviour
{
bool paused;
// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(KeyCode.Space))
{
Debug.Log(“clicked space”);
paused = true;
Debug.Log(paused);
}
if(paused & Input.GetKeyDown(KeyCode.Space))
{
Debug.Log(“cliked space”);
paused = false;
}
}
}