Random range only returning zero
Can't seem to get any values for random range, just zeros.
pragma strict
ar mazesize= 50; var solidfloorperc=75;// are the holes in floors? var solidwallperc=75;// are the holes in walls? var numofroms=2; var offset=1.0;//size of blocks var roomlength=15; var floorblock1=transform; var numoffinfloors=0; var bump=0;
var a=0; function Start () { buildfloors(); } //----------------------------------------------------------------- function Update () {
if (a==0){
//buildwalls(); a=1;
} } //---------------------------------------------------------------- function buildfloors(){
for (var ii=0; ii
Answer by springwater · Jul 27, 2016 at 12:16 PM
ok, i found it, it was that I initialized a value to an int, but asked random for a float.. then tried to store the float in the int.
Your answer
Follow this Question
Related Questions
Can I generate values outside of the Random.insideUnitCircle?? 1 Answer
Random Range function changed? 2 Answers
Random.Range gives the same value in WebGL Build 0 Answers
Instantiating random prefabs gives wrong position 3 Answers
Random generated rooms in network multiplayer,Randomly generated rooms in mulitplayer 0 Answers