W
W
WasTabon2021-09-18 16:03:03
C++ / C#
WasTabon, 2021-09-18 16:03:03

Can't create an instance of the Random class?

using System.Collections;
using System.Runtime;
using System.Collections.Generic;
using UnityEngine;
public class SpawningClickiongETC : MonoBehaviour
{
    Random rnd = new Random();
  }

6145e38119666329595548.png
Here's what it gives

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-09-18
@WasTabon

You don't have a System in your usings, so some Random is imported from the unit.
Try to writeSystem.Random rnd = new System.Random();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question