Quantcast
Channel: Questions in topic: "points-counter"
Viewing all articles
Browse latest Browse all 51

How do I make a score system?

$
0
0
I do the tutorial score manager but when I do everything it does not work. PLEASE HELP. Here's the Enemy Health - using System.Collections; using UnityEngine; public class EnemyHealthManager : MonoBehaviour { public int MaxHealth; public int CurrentHealth; public int scoreValue = 10; // Use this for initialization void Start() { CurrentHealth = MaxHealth; } // Update is called once per frame void Update() { if (CurrentHealth <= 0) { Destroy(gameObject); } } public void HurtEnemy(int damageToGive) { CurrentHealth -= damageToGive; } public void SetMaxHealth() { CurrentHealth = MaxHealth; } public void Scoring() { ScoreManager.score += scoreValue; } } Here's the ScoreManger - using UnityEngine; using UnityEngine.UI; using System.Collections; public class ScoreManager : MonoBehaviour { public static int score; Text text; void Awake() { text = GetComponent(); score = 0; } void Update() { text.text = "Score: " + score; } }

Viewing all articles
Browse latest Browse all 51

Trending Articles



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