'Random' does not contain a definition for 'Range'?
Im trying to select a random string from an array But when I try to use Random.Range I get an error that says "'Random' does not contain a definition for 'Range'"
It exists in the API so why isn't it working?
Please post your code. Also, try using UnityEngine.Random.Range().
This issue is basic c# knowledge, might aswel have posted this on stackoverflow. Or at the least do you research before you post a question. This has been answered on several threads, just 1 search and first 3 top questions have the answer.
You could have skipped all the condescension and simply posted a link to the threads as well. The point you are making has been made in several threads there as well, and yet here your point is.
Answer by eatsleepindie · Nov 29, 2017 at 09:06 PM
If you have this (or something similar):
using System;
Then you may need this:
UnityEngine.Random.Range(0f, 100f);
Both System and UnityEngine have Random, so if both are included, you need to specify.
Your answer
Follow this Question
Related Questions
NullReferenceException, Script Error 1 Answer
how can i resolve this script inventary 1 Answer
How do I fix this error? 0 Answers
how do you correct errors in a script? 0 Answers
Scripts works on PC, not android. 0 Answers