It works, not only two if's, multiple if's. For example, if you pressed the F key, we are going to check if we have the flashlight (with a bool), and then checks if there is enough battery (with float battery). These are imported from UnityEngine namespace:
public float battery;
public bool haveFlashlight;
void Update()
{
if (Input.GetKeyDown(KeyCode.F))
{
if (haveFlashlight)
{
if (battery is greater than 0, I cannot write it here because the text editor does some weird thing when I write the greater than symbol)
Answers
yeah i tried before u answer an it worked but thx
It works, not only two if's, multiple if's. For example, if you pressed the F key, we are going to check if we have the flashlight (with a bool), and then checks if there is enough battery (with float battery). These are imported from UnityEngine namespace:
public float battery;
public bool haveFlashlight;
void Update()
{
if (Input.GetKeyDown(KeyCode.F))
{
if (haveFlashlight)
{
if (battery is greater than 0, I cannot write it here because the text editor does some weird thing when I write the greater than symbol)
{
\\turn on flashlight
}
}
}
}