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

Unity 5 JS, Score does not work.

$
0
0
I watched a tutorial on YT (From unity 4) of making a score in a simple game, i writed a short script (Like in this tutorial) = #pragma strict static var currentScore : int = 0; var offsetY : float = 40; var sizeX : float = 100; var sizeY : float = 25; function OnGUI () { GUI.Box (new Rect (Screen.height*0.5, Screen.width/2-sizeX/2, offsetY, sizeX, sizeY), "Score: " + currentScore); } Then I got an error = Assets/GameMaster.js(11,18): BCE0024: The type 'UnityEngine.Rect' does not have a visible constructor that matches the argument list '(float, float, float, float, float)'. Please solve my problem (: Photo of script: [Click](http://imgur.com/jtyMciZ)

Viewing all articles
Browse latest Browse all 1875

Trending Articles



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