error in flashlight script

Hi I have error in flashlight script 12-17 CS0103: The name flashlightobject and F

¨using UnityEngine;
using System.Collections;

public class Flashlight : MonoBehaviour 
{
	public Light flashlighObject;
	public float powerLevel = 100.0f;


	void Start () 
	{
		flashlightObject.enabled = false;
	}

	void Update () 
	{
		if(Input.GetKeyDown(KeyCode:f))
		{
			if(flashlightObject.enabled == false)
			{
				flashlighObject.enabled = true;
			}	
			else
			{
				flashlighObject.enabled = false;
			}
		}
		if(flashlightObject == true)
		{
			powerLevel -= 1.0f;
		}
	}
}
¨using UnityEngine;

using System.Collections;

 

public class Flashlight : MonoBehaviour 

{

    public Light flashlightObject;

    public float powerLevel = 100.0f;

 

 

    void Start () 

    {

        flashlightObject.enabled = false;

    }

 

    void Update () 

    {

        if(Input.GetKeyDown(KeyCode.F))

        {

            if(flashlightObject.enabled == false)

            {

                flashlightObject.enabled = true;

            }   

            else

            {

                flashlightObject.enabled = false;

            }

        }

        if(flashlightObject== true)

        {

            powerLevel -= 1.0f;

        }

    }

}

What is the error you are getting?

Ok work it :)) Thank you :slight_smile:

Hey and how to create a Energy Bar?? :open_mouth: :slight_smile: