Answer the question
In order to leave comments, you need to log in
Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement error in script. How to fix?
So I am writing a small connecting script, I
wrote it, I save it, I go to Unity,
and he hints at this script and writes that this error is in it.
Script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FoodEat : MonoBehaviour {
public int Tiod = 0;
public void Buy()
{
Tiod == 1;
}
}
Answer the question
In order to leave comments, you need to log in
Double equals is a comparison, single is an
assignment
https://msdn.microsoft.com/en-us/library/sbkb459w.aspx
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question