I’m getting 2 errors on this code. I wanted to see if anyone could help me fix them. The two errors I’m receiving are the following:
error 1:Assets/Scripts/playerAttack.cs(28,9): error CS1525: Unexpected symbol `}’
error 2:Assets/Scripts/playerAttack.cs(29,1): error CS8025: Parsing error
Thanks for any aid you guys can provided.
using UnityEngine;
using System.Collections;
public class playerAttack : MonoBehaviour
{
public GameObject target;
// Use this for initialization
void Start ()
{
}
// Update is called once per frame
void Update ()
{
if(Input.GetKeyUp(KeyCode.F))
{
Attack();
}
}
private void Attack()
{
enemyHealth eh = (enemyHealth)target.GetComponent("enemyHealth");
eh.AddjustCurrentHealth(-10)
}
}