Follow

What is CS0200?

Symptoms

When trying to enter play mode, I am receiving the error below:

error CS0200: Property or indexer `__' cannot be assigned to (it is read only)

Cause

The CS0200 error is caused when you try to assign a value to a variable that can only be read and not changed.

Error displayed in this example:

error CS0200: Property or indexer `UnityEngine.GameObject.activeSelf' cannot be assigned to (it is read only)

Resolution

To fix the CS0200 error you will need to find an alternative way of achieving the desired result. In this example we have a method that allows us to set the game object as active.

More Information

https://msdn.microsoft.com/en-us/library/fd8axwct(v=vs.90).aspx

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.