Answers for "inactive after active with press key unity"

C#
1

inactive after active with press key unity

if (Input.GetKeyDown(KeyCode.Escape))
{
    yourObject.SetActive(!yourObject.activeSelf);
}
Posted by: Guest on December-16-2020
1

inactive after active with press key unity

public GameObject shieldObject;

if (Input.GetKeyDown(KeyCode.LeftShift))
{
    shieldObject.SetActive(true);
}
else if (Input.GetKeyUp(KeyCode.LeftShift))
{
    shieldObject.SetActive(false);
}
Posted by: Guest on December-16-2020

Code answers related to "inactive after active with press key unity"

C# Answers by Framework

Browse Popular Code Answers by Language