Random.InitState
I'm having issues with using the Random.InitState(), keep getting Random does not have a definition for InitState.
I viewed previous comments that had similar messages... My class is scrGameManager and I'm not using a System.Random anywhere
I tried initializing a Random gameRdmNbrs but end up with the same errors so I'm at a loss, the documentation says there is a InitState function.....
Any suggestions?
Do you have:
using System;
namespace import in the class?
Are you using a seed parameter to InitState as there isn't a parameterless InitState static function in UnityEngine.Random.InitState(someIntValueForSeed)?
Have you tried to fully qualify the namespace when invoking this static function?
UnityEngine.Random.InitState(39834);
Answer by tkati · Sep 14, 2016 at 01:31 AM
I remember trying fully qualifying, same message, no not using using System because from my understanding that is using the non unity libraries, I was trying to use the Unity version, and from my understanding that uses UnityEngine which I had listed.
I read once upon a time that one might have to explicitedly type in a special command to avoid the system from getting confused/ can't find out what that was for the life of me, might be imagine things though too.
I guess it's not a huge deal because I have the System.Random working, maybe something has changed in the newer versions, I'm using 5.3.5f1 and reading 5.4 documentation so....
Answer by glenneroo · Aug 06, 2018 at 02:29 AM
Do you mean?
UnityEngine.Random.InitState(System.Environment.TickCount);
Your answer
Follow this Question
Related Questions
How to add a Type to a Class in Javascript? 1 Answer
increase score with a variable from another script 1 Answer
Generating random points and instantiating prefabs with a set distance 0 Answers
Script not working for me 2 Answers
How to set a variable of a non-monobehavior script from a monobehaviour script 0 Answers