So I’m Following a Melee Attack Script Tutorial And I Ran Into This error CS0117 I Checked It Myself Idk If It Is a Spelling Error Or Thats The Problem, Any Help?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FPSFirstCombat : MonoBehaviour
{
public Animator animator;
public Transform Attackpoint;
public float attackRange = 0.5f;
public LayerMask enemyLayers;
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.G))
{
Attack();
}
}
void Attack()
{
animator.SetTrigger("Attack");
Collider[] hitEnemies = Physics.OverlapSphereAll(Attackpoint.position, attackRange, enemyLayers);
foreach(Collider enemy in hitEnemies)
{
Debug.Log("We hit " + enemy.name);
}
}
void OnDrawGizmosSelected()
{
if (Attackpoint == null)
return;
Gizmos.DrawWireSphere(Attackpoint.position, attackRange);
}
}
Any Help?,Thank You