Question by
windows123 · Feb 10, 2018 at 12:00 PM ·
error message
What is problem? Assets/classs.cs(14,10): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class classs : MonoBehaviour {
public GameObject light;
TOD_Sky ts; // this is script
public int time=19;
void Start () {
if (ts.Cycle.Hour < time) {
light.SetActive = true;
}
}
// Update is called once per frame
void Update () {
}
}
Comment
Best Answer
Answer by Bunny83 · Feb 10, 2018 at 12:13 PM
SetActive is a method, not a variable. So this line makes no sense:
light.SetActive = true;
You probably want to do:
light.SetActive( true );
This will execute the method SetActive and pass "true" as parameter.
Your answer
Follow this Question
Related Questions
Unity Keeps Crashing!!,One project keeps crashing 0 Answers
Import project on same Unity editor from collab errors 0 Answers
Error message in 3D game tutorial 0 Answers
I Keep Getting Error After Implementing AdMob IDK what it means 0 Answers
Object reference not set to an instance of an object with raycast2d 0 Answers