So here’s what I’m trying to do-
I want to create a boolean that determines weather or not a key’s input will actually go through. This particular key is used in several different scripts and I don’t want to have to change all 11 of them and would rather just enable/disable the key itself.
I should also note it’s not linked to a specific key on the keyboard, it has its own button name and everything. If someone can give me an answer I would be endlessly grateful.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CanSwap : MonoBehaviour
{
public bool enableSwapping;
void Start()
{
}
// Update is called once per frame
void Update()
{
if (enableSwapping == true)
{
//Enable the "Swap Dimensions" button
}
else
{
//Disable the "Swap Dimensions" button
}
}
}