Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Adding varibales from other scripts

$
0
0
I have three scripts: Variable: static var score = 0; Present 1: var score= Variables.score; function OnTriggerEnter () { score = score+1; } and win: var score= Variables.score; function Update(){ if(score==1){ Application.LoadLevel("Level 1"); } } Basically I have the var for the score and when I collide with a collider it should add 1 to the variable. for testing weather the script works we are just starting at if the variable score equals on, but its not working. Any ideas?

Viewing all articles
Browse latest Browse all 171066

Trending Articles



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