I'm just starting so i dont know very much can anyone help
this is the error
Assets/Scripts/HurtPlayer.cs(26,39): error CS1501: No overload for method `HurtPlayer' takes `2' arguments
here is the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class HurtPlayer : MonoBehaviour {
public int damageToGive = 1;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Player")
{
Vector3 hitDirection = other.transform.position - transform.position;
hitDirection = hitDirection.normalized;
FindObjectOfType ().HurtPlayer(damageToGive, hitDirection);
}
}
}
↧