So I’m trying to make a UI, and am trying to set it so a button will pop up a screen and it will use PerformInteractiveRebinding to get the input and change a button to say the value. The problem is that the screen will show up, but when I press and input, it won’t be registered by the input system and the screen will not go away. I am new to Unity, so my code probably has a ton of things wrong. Thanks!
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.InputSystem;
public class Controls : MonoBehaviour
{
public GameObject InputPanel;
public InputActionReference m_actionReference;
private InputAction m_action;
// Start is called before the first frame update
void Start()
{
m_action = m_actionReference.action;
}
// Update is called once per frame
void Update()
{
}
public void CallChangeControls(){
ChangeControls(m_actionReference);
}
public void ChangeControls(InputAction player) {
InputPanel.SetActive(true);
var rebind = player.PerformInteractiveRebinding()
.WithControlsExcluding("Mouse").OnComplete(operation => CCC());
}
public void CCC(){
InputPanel.SetActive(false);
}