Health attribute

Jyisnotter

New member
Hi,
I am trying to alter the health attribute but I keep getting a compiler error

My code:

private void Start()
{
var attribute = m_AttributeManager.GetAttribute(“Health”);
attribute.Value += 10;
}


When I compile the code I receive this error:

error CS1056: Unexpected character '"'


I am confused as I got this code directly from the documentation.


Any help at all would be appreciated, thanks in advance
 
Line 20, it doesn't seem to like the quotation marks on health for some reason.
 

Attachments

  • VS code error.png
    VS code error.png
    15.8 KB · Views: 6
What is line 20 in your script? The documentation script doesn't have a line 20.
 
Thanks, that code looks correct. Maybe the quotes are a unicode symbol? Try typing it out instead of copy and pasting.
 
Haha! That seems to have fixed it. I feel pretty silly now for not just typing it out rather than copy and paste.
Thanks :)
 
Top