for some reason thats beyond me this damn script wont run due to a parsing error in monodevelop help please.! the parsing error is on the debug btw
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.GetKeyDown (KeyCode.F)) {
Attack();
}
}
private void Attack() {
float distance = Vector3.Distance (Target.transform.position, transform.position);
Vector3 dir = (Target.transform.position - transform.position).normalized;
float direction = Vector3.Dot(dir, transform.forward)
Debug.Log(direction);
if (distance < 3) {
if(direction > 0) {
EnemyHealth eh = (EnemyHealth)Target.GetComponent (“EnemyHealth”);
eh.Addjustcurrenthealth (-10);
}
}
}
}