I am having a problem with this script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class contactDamage : MonoBehaviour {
playerHealth ph;
public int attackDamage = 5;
public GameObject player;
public float attackTimer;
float timer;
void Awake()
{
player = GameObject.FindGameObjectWithTag("Player");
ph = player.GetComponent<playerHealth>();
}
void Update()
{
timer += Time.deltaTime;
}
public void OnCollisionStay2D(Collision2D other)
{
if(other.transform.tag == "Player" && timer >= attackTimer)
{
//ph.TakeDamage(attackDamage);
Attack();
}
}
void Time()
{
}
void Attack ()
{
ph.TakeDamage(attackDamage);
timer = 0f;
}
}
I keep on getting the error: Assets/contactDamage.cs(31,23): error CS0023: The ‘.’ operator cannot be applied to operand of type ‘method group’