+1 vote

Whenever I try to use Random.Randi() etc I get an error: Random does not contain a definition Randi. Since no one else seems to be having this problem I'm assuming it is a problem with me. Can someone please tell me how I'm supposed to use Random this is driving me insane.

asked Feb 25, 2018 in Engine by ahubb343 (13 points)
reshown Feb 25, 2018 by ahubb343

Nevermind I figured it out. If anyone else has this problem what I did was instead of using the Random.Randi() like the documentation says I created a new Random object, and called called the Next() method from it. Like this:

Random rnd1 = new Random();
num = (rnd1.Next() % 10);

I also updated my .NET framework from here. Not sure if that was what fixed it though.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.