Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Keeping points tallied

$
0
0
Hey all! I'm currently working on an arcade style game where you fire spheres at targets to gain points. Something is not quite right with part of my code, though. Whenever the player character fires at another object, the score resets instead of adding onto itself. I'm still pretty bad with programming and sort of threw this together with help from a friend: ____ import UnityEngine.UI; var ScoreManager : Text; var score : int = 0; function OnCollisionEnter (col : Collision){ if(col.gameObject.tag == "Bullet"); { score += 0; ScoreManager.text = score.ToString(); _____ What exactly am I missing? Thank you for your time!

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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