Hello can someone help me please , im new to Unity and C# ::CS1061::

So im really new to C# and Unity ive been using it for some days now , and ive been following a tutorial and have reached a point where an error appears and i just can’t fix it.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class CreateEnemyBtn : MonoBehaviour
{
[SerializeField]
private GameObject targetEnemyUnitPrefab;
//where in interface the button will appear

[SerializeField]
private Vector2 initialPosition, itemDimensions;
[SerializeField]
private KillEnemy killEnemyScript;
void Awake()
{
// Find the units menu.
GameObject enemyUnitsMenu = GameObject.Find(“EnemyUnitsMenu”);
//Calculate the item position
GameObject[ ] existingItems = GameObject.FindGameObjectsWithTag(“TargetEnemyUnit”);
Vector2 nextPosition = new Vector2(
initialPosition.x + (Mathf.Pow(-1,existingItems.Length)*50 + 50),
initialPosition.y -50 * existingItems.Length + 50
);
//instantiate the item
GameObject targetEnemyUnit = Instantiate(targetEnemyUnitPrefab, enemyUnitsMenu.transform);
targetEnemyUnit.name = “Target” + gameObject.name;
targetEnemyUnit.transform.localPosition = nextPosition;
targetEnemyUnit.transform.localScale = new Vector2(1, 1);

targetEnemyUnit.GetComponent().onClick.AddListener (() => SelectEnemyTarget());
killEnemyScript.menuItem = targetEnemyUnit;
}
public void SelectEnemyTarget()
{
}

The error that appears is
Assets\TheGame\CombatStuff\Combat Characters\EnemyParty\Slime\CreateEnemyBtn.cs(39,48): error CS1061: ‘Button’ does not contain a definition for ‘onClick’ and no accessible extension method ‘onClick’ accepting a first argument of type ‘Button’ could be found (are you missing a using directive or an assembly reference?)

Thanks in advance !

Always use code tags when posting code.
Since the error claims Button doesn’t define onClick, the one possible option might be you have another script named Button and it’s not using Unity’s Button class.

Double check that you haven’t defined your own Button class or that a plugin doesn’t define one.

Thank you Brathnann Ill check that ! im pretty sure i have a script named button !

it was that thank you Brathann!