Jump to content

Multiple RegisterForSingleUpdateGameTime's on one script


Recommended Posts

My brain has gone foggy and I could do with some advice.

 

I have multiple functions on one script, that handle multiple options for the player, all needing to registerforsingleupdategametime. Then onupdategametime i have split those options off to other functions based on a globalvariable (or two). All of the registers have different timescales.

 

Of course, when i call registerforsingleupdategametime the engine ignores any previous calls and just updates the last one. This is obviously a problem.

 

Is there a structure i can use, states or somesuch, within a single script, to have the registers not be discounted? Or when i need to register would i be better off instead pointing the script to a function on another script (or my fear, multiple other scripts) that handle the registers/updates then final functions?

 

Any suggestions gratefully recieved on how best to tackle this.

 

Link to comment
Share on other sites

I think your best bet is to use multiple other scripts unfortunately. Note that they must be attached to different forms. If they are attached to the same form RegisterForSingleUpdate will affect all of the scripts attached to that form. You can use like dummy misc items or something.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...