Error CS0104

Hello guys,
I am new to Unity and learn with some tutorials from YouTube but now I got the error CS0104 and I dont know what I should do. The error is in every line with “Random.Range”. Here is my skript I hope you can help me

using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Threading;
using UnityEngine;

public class obstacle_spawnen : MonoBehaviour
{
public GameObject[ ] obstacles;
public List obstaclesToSpawn = new List();

int index;

void Awake()
{
InitObstacles();
}

void Start()
{
StartCoroutine(SpawnObstacles());
}

void InitObstacles()
{
index = 0;
for (int i = 0; i < obstacles.Length; i++)
{
GameObject obj = Instantiate(obstacles[index], transform.position, Quaternion.identity);
obstaclesToSpawn.Add(obj);
obstaclesToSpawn*.SetActive(false);*
index++;
if (index == obstacles.Length)
{
index = 0;
}
}
}
IEnumerator SpawnObstacles()
{
yield return new WaitForSeconds(Random.Range(1.5, 4.5f));
int index = Random.Range(0, obstaclesToSpawn);
while (true)
{
if (!obstaclesToSpawn[index].activeInHierarchy)
{
obstaclesToSpawn[index].SetActive(true);
break;
}
else
{
index = Random.Range(0, obstaclesToSpawn);
}
}
StartCoroutine(SpawnObstacles());
}
}

1.5 is a double value whereas 4.5f is a float value. Random range takes two floats not a double and a float. Try using 1.5f. Note that compile errors are C# language errors and not Unity errors so you can find plenty of info by searching for those error codes.

A couple of extra things; the 2D forum is for discussions on 2D features. What you’re asking is a general scripting question more appropriate here. Also, when posting code you can use code tags for formatting rather than plain-text.