Greetings,
I’ve added a help screen to my game to display control mappings. I am able to display the screen with a button that I added:
However, I would also like to display the screen if the user presses F1.
I’ve added the following script to my HelpScreen GameObject:
using UnityEngine;
public class HelpScreen : MonoBehaviour
{
[SerializeField]
PauseManager pauseManager = null;
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.F1))
{
Debug.Log("F1 pressed.");
if (pauseManager != null)
{
pauseManager.PauseGame(false);
gameObject.SetActive(true);
}
else
{
Debug.Log("pauseManager unassigned.");
}
}
}
}
It appears that the F1 keypress is never registering. I never get the log message I’m emitting for it and the help screen doesn’t display.
Any ideas why that would be?
And while I’ve got your attention, does anybody know of any attractive keyboard & mouse icons/sprites I would put on the help screen instead of plain text?
Thanks.