- Home /
This question was
closed Dec 25, 2014 at 06:47 PM by
Graham-Dunnett for the following reason:
Duplicate Question
Question by
bot-93 · Dec 25, 2014 at 06:46 PM ·
cs0120object-oriented-programming
trying to update the guiText.text component only when required
im getting the following error when im tyring to call a very specific function only when required so that i can update the HUD rather then doing a call every frame
Player.cs(61,47) error CS0120: An object reference is required to access non-static member `UnityEngine.Component.guiText'
player player1 = new player();
void updateHUD() {
this.guiText.text = "Health: " + player.CalculatePlayerHealth (0,0);
}
if anyone can fix my code id be greatful and ive looked everywhere for an answer...
Comment
Follow this Question
Related Questions
Help writing a script for multiply spawn points. 1 Answer
How unity works under the hood? 0 Answers
Roll-A-Ball tutorial error when attaching movement script to ball 0 Answers
Change the size of an object, but only one side 1 Answer
Error CS0120 0 Answers