HelpBool Error

Posts 1–3 of 3 · Page 1 of 1
Bool Error
Can anyone help me with this? I am new to coding so please help. I already add all the references but still not working, which references that I'm missing? (Sorry I don't know how to post a picture at here so heres the link of my problem)

i(dot)imgur(dot)com/W38O2YY(dot)png?1
Might have something to do with the fact your using Zths's code. If you don't understand it you probably shouldn't use it. He using a class called Helper to "Help" him with simple things such as getting the player and getting the main camera. What the Helper.getmylife() is doing is calling a function in the Helper class, that function will return the players Life object so you can make changes to it. Instead of doing that you can do this:

Code:
                Life[] LifeArray = UnityEngine.Object.FindObjectsOfType(typeof(Life)) as Life[];
                foreach (Life Life in LifeArray)
                {
                    //Life stuff here.
                }
Serves the same purpose but is slightly longer, if you want to do something better you can make it into a function and return the Life, then you could just call the function like the code you posted currently does. If you kinda new, stick with the method i posted above.
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?