Good news! To provide faster support and grow the community, we'll be changing the forum to "Read Only" and turn to Discord instead for support.
Join here: https://discord.gg/zjNj5zZ

[solved]How to create a Hunger Bar? Thank U!!!!

HAChunOwoo
Posts: 6
Joined: Sun Jul 30, 2017 3:04 am

Re: [Solved]How to create a Hunger Bar?I need help

Postby HAChunOwoo » Mon Aug 07, 2017 5:30 am

Shockwolf wrote:
HAChunOwoo wrote:
how to use InvokeRepeating?


Basically you set up a Method and then you use InvokeRepeating to call it over and over again beginning from the Start() method.

So let's say you set up a Method you want to repeat every so often...

Code: Select all

void IWantTheseLinesOfCodeToRepeat()

{
   // Do Something here, every time IWantTheseLinesOfCodeToRepeat is called.
     Debug.Log("I'm being Invoked.");
}


And then you set it going like this...

Code: Select all

void Start()
{
 //DELAYS AND REPEATS A FUNCTION/METHOD STARTING IN 2 SECONDS AND REPEATS EVERY 2 SECONDS.
  InvokeRepeating("IWantTheseLinesOfCodeToRepeat", 2f, 2f);
  Debug.Log("I've Just Invoked IWantTheseLinesOfCodeToRepeat for you.");
}


You can also cancel an invoke with:

CancelInvoke("FunctionName");

Or invoke without repeating at a set time with:

Invoke("FunctionName", 2f);

Hope this helps. :)



thx it work!!!!!!!! wowowowwowo
you are the best xd

Shipright
Posts: 68
Joined: Tue Jul 12, 2016 7:24 am

Re: [solved]How to create a Hunger Bar? Thank U!!!!

Postby Shipright » Tue Aug 08, 2017 7:29 pm

Would you mind posting your completed script?

Shockwolf
Posts: 49
Joined: Sat Feb 18, 2017 11:03 am
Contact:

Re: [Solved]How to create a Hunger Bar?I need help

Postby Shockwolf » Wed Aug 09, 2017 4:01 am

HAChunOwoo wrote:thx it work!!!!!!!! wowowowwowo
you are the best xd


Thanks! :D Glad it works.

Shipright wrote:Would you mind posting your completed script?


I already posted it in this topic:

viewtopic.php?f=25&t=2898


Return to “Visuals”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest