Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

C# damage script help

$
0
0
I have borrowed this script in C#, which I attatch to my enemies. However, it keeps saying that there is a parsing error on the last line. using UnityEngine; using System.Collections; public class EnemyHealth : MonoBehaviour { public int maxHealth = 100; public int curHealth = 100; //initialization void Start () { } // Update void Update () { if (curHealth <1){ Destroy(gameObject); } } void OnCollisionEnter(Collision col) { if (col.gameObject.tag == "Bullet"){ curHealth -= 20; Destroy(col.other); } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>