- Home /
Panel isn't opening after hitting the tab key, and its not even saying I pressed the key?
When I run my program, it doesnt even say "Key pressed" in my debug line, on top of that, the panel is not opening after hitting "tab".
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TabPanel : MonoBehaviour
{
public TabPanel tabPanel;
private void Start()
{
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.Tab))
{
tabPanel.gameObject.SetActive((tabPanel.gameObject.activeSelf)); //need to add this line to make the toggling work
Debug.Log("Key pressed");
}
}
}
Comment
Your answer
Follow this Question
Related Questions
How to get Key with KeyCode.Question? 1 Answer
Stimulate key press via a GUITexture 0 Answers
KeyCode to Ui ? for mobile 1 Answer
Numpad Keypress not being registered on mobile phone. 0 Answers
Assign keystrokes to GUI button 2 Answers