error CS0119: Expression denotes a `type', where a `variable', `value' or `method group' was expected

Hello everyone. I have an error and I don’t know how can I fix it.

Here is the code!

using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class Spawn : MonoBehaviour {

	public float maxHeight;
	public float minHeight;

	public float rateSpawn;
	private float currentRateSpawn;

	public GameObject tubePrefab;

	public int maxSpawnTubes;

	public List<GameObject> tubes;

	private GameController gameController;

	// Use this for initialization
	void Start () {

		for (int i=0; i<maxSpawnTubes; i++) {
			GameObject tempTube = Instantiate (tubePrefab) as GameObject;
			tubes.Add (tempTube);
			tempTube.SetActive (false);
		currentRateSpawn = rateSpawn;

		gameController = FindObjectOfType (typeof(GameController)) as GameController;

	// Update is called once per frame
	void Update () {

		if (gameController.GetCurrentState () != GameStates.INGAME)
		currentRateSpawn += Time.deltaTime;
		if (currentRateSpawn > rateSpawn) {
			currentRateSpawn = 0;


	private void RateSpawn(){
		float randHeight = Random.Range(minHeight, maxHeight);

		GameObject tempTube = null;

		for (int i=0; i<maxSpawnTubes; i++) {
			if(tubes*.activeSelf == false){*

_ tempTube = tubes*;_

* if(tempTube != null){*
* tempTube.transform.position = new Vector3(transform.position.x, randHeight, transform.position.z);*
* tempTube.SetActive(true);*
* }*

* }*


and the error is it (error CS0119: Expression denotes a type', where a variable’, value' or method group’ was expected)
“46. Spawn();” - error
Thankyou for all answers.

Spawn is your class name so I’ve looked quickly through your code and seems like you most likely wanted to call RateSpawn function:

//change your line#46 to this:

If not then let me know what you expected from calling class like a function? so that I’ll be able to help you further.