Hello.
can someone help me? cause i wrote a script in c# This is the script:
using UnityEngine;
using System.Collections;
public class BulletInfo : MonoBehaviour {
public float BulletDestroy = 1.0f;
public float BulletDamage = 10;
public GameObject Target;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
Destroy(gameObject, BulletDestroy);
}
void OnTriggerEnter(Collider other) {
if(other.gameObject.CompareTag("Enemy"))
Target.GetComponent<EnemyHealth>().curHealth -=BulletDamage;
}
}
But now i got an error:
Error CS0266 Cannot implicity convert type float to int an explicit conversion exist (Are you missing a cast?)