How to Instantiate Multiple Random()'s?

Hi All,

I apologize if this has been answered before, but I could not find a workable answer through quite a bit of searching.

I want to have two separate Randoms active at the same time. Is it possible in any way without creating my own Random class? I want to utilize some of the functionality already present in Unity’s Random.

For background on what I’m doing - I want to have one Random that can be regularly seeded during play to create 100% reproducible results (textures, for example). I want the other Random to be seeded only once to handle all additional Random cases (damage, etc…).

I’d appreciate any help you can give!

Regards.

Create one as a static variable, and one not. The static one need never be instantiated again, and so by calling that, you can get a completely random number (what I tend to do is use a static class for general mathematical operations, and create methods in that to get random numbers, grabbing them from a single Random field in that class). You can then create the other one as a separate field, which you can seed independently. If you want them to be totally different, you can also use System.Random for one of the random class, instead of Unity’s Random class.