- Home /
Question by
kushgodofhope · Feb 22, 2014 at 11:08 AM ·
javascriptrandom
Random.range can only be called from main thread
i'm trying to randomize these values between -180 and 180 on startup but i get the error.. " Argumentexception : RandomRangeInt can only be called from main thread." not sure what this means, what am i doing wrong here? i'm using java
var rotX : int;
var rotY : int;
var rotZ : int;
function Start()
{
rotX = Random.Range(-180, 180);
rotY = Random.Range(-180, 180);
rotZ = Random.Range(-180, 180);
}
Comment
You must have some other code that is using Random.Range - because what you have there is fine.
Dont do this:
var rotX : int = Random.Range(-100,100);
Your answer
Follow this Question
Related Questions
Can someone help me fix my Javascript for Flickering Light? 6 Answers
Setting Scroll View Width GUILayout 1 Answer
Z rotation locks to certain value randomly? 0 Answers
Adding GUI to this 1 Answer
Spawn gameObjects at random locations in limited area 4 Answers