hi…
I want to make a simple button system like this : when I pressed(key get up) space make it true. when I pressed(key get up again) again , make it false… and so on… like every on/off buttons. but I can’t make it… this is my script and it won’t work… what should I do?
using UnityEngine;
using System.Collections;
public class Moving : MonoBehaviour {
public bool but = true;
void Update()
{
if (Input.GetButtonUp("Space") && but == true)
{
but = false;
}
if (Input.GetButtonUp("Space") && but == false)
{
but = true;
}
}
}