- Home /
Error (Read Only)
I recently decided to start following Petey's tutorial series on www.burgzergarcade.com as a way to get my feet wet with C#. So far so good til last night when I seem to be getting an error message that he isn't getting and after spending about 4 hours trying to figure out what I did wrong I am at a loss.
He is writing the code at about 9 minutes into this video : http://www.burgzergarcade.com/tutorials/game-engines/unity3d/032-unity3d-tutorial-playerprefs-6x
The error code I am getting is : Assets/Scripts/Character Classes/CharacterGenerator.cs(192,45): error CS0200: Property or indexer `Vital.CurValue' cannot be assigned to (it is read only)
The part of my code it is referencing is :
private void UpdateCurVitalValues()
{
for(int cnt = 0; cnt < Enum.GetValues(typeof(VitalName)).Length; cnt++)
{
_toon.GetVital(cnt).CurValue = _toon.GetVital(cnt).AdjustedBaseValue;
}
}
If you need me to plug in mroe of my code just let me know and I thank you in advance for the help.
Answer by Ajaxx84 · Dec 16, 2012 at 06:04 PM
Realized in my Vital class I never placed a Setter in my CurValue. Doing so solved this problem.