Type "bool" does not contain definition for "GetComponent"of type bool could be found

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Karak : MonoBehaviour {

public float can,aclik,su,hiz,hizz,hizzz,cand,karakterbari;
public GameObject canbar,aclikbar,subar;
public Text canyazi,aclikyazi,suyazi;
public bool Karakterpanel;
void Start () {

}

void Update () {

if (Input.GetKeyDown(KeyCode.C) ) {

Karakterpanel = !Karakterpanel;
if(Karakterpanel){

Karakterpanel.GetComponent().Play(“Animasyon”);
}

if (!Karakterpanel) {
Karakterpanel.GetComponent().Play(“Animasyon”);
}
}

canbar.transform.localScale = new Vector3(can/100,1,1);
aclikbar.transform.localScale = new Vector3 (aclik/100,1,1);
subar.transform.localScale = new Vector3 (su/100,1,1);
canyazi.text = “%” + (int)can;
aclikyazi.text = “%” + (int)aclik;
suyazi.text = “%” + (int)su;

if(aclik > 0) {

aclik -= hiz*Time.deltaTime;

}
if (su > 0) {

su -= hizz * Time.deltaTime;

}

if (aclik <= 10) {
Debug.Log (“I’m hungry”);
can -= hizzz * Time.deltaTime;

}
if (su <= 20) {
Debug.Log (“I’m Thirsty”);
can -= cand * Time.deltaTime;

}

if (can > 100) {
can = 100;

}
if (can <= 30) {
Debug.Log (“I Feel Bad”);
}

if (can <= 0) {
Debug.Log(“You Dead”);
can = 0;

}

if (aclik > 100) {
aclik = 100;

}
if (su > 100) {
su = 100;

}

if (aclik > 90) {
can += hizzz * Time.deltaTime;

}
if (su > 90) {
can += cand * Time.deltaTime;

}

}

}

Use code tags!

Yes, use code tags…

But the explanation is pretty clear. You are trying to use GetComponent call from a bool

You declare public bool Karakterpanel; and then later you’re trying to use that bool to get a component. You can’t use getComponent from a bool variable.

try something like this and if .Play() returns a bool then it will work

Karakterpanel = GetComponent().Play(“Animasyon”);