Jump to content

Mod question about timer


Recommended Posts

I always use:

inst:DoPeriodicTask(time, function, nil, inst)  

but it's not 100% accurate and may be hard on your PC when it calls a function few times a second.

Ultroman covered this matter in this auras tutorial - https://forums.kleientertainment.com/forums/topic/110362-tutorial-making-auras-using-doperiodictask-and-dotaskintime/

My simple brain understood that, so you shouldn't have any problems. Cheers!

 

Link to comment
Share on other sites

The timer component is better suited for longer duration timers that don't trigger as often and you wish to save/load the remaining time with its associated entity. Otherwise, DoPeriodicTask is more appropriate. Assign the task to a variable if you intend to cancel it at any point.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...