x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Possible BUG with Timers in C++

Version 4.9.1 actually.

Before 4.9.1 my timers were executing properly now there's a specific timer that no longer works and some others work sometimes and does not work.

It could be because of how I'm creating my timers I'm not sure if there's now an extra step to creating timers but I use

GetWorldTimerManager().SetTimer and clear timer with it.

I also use FTimerHandle variables for specific things.

to give you an example of what I'm calling ..

FTimerHandle THResetCombo,THRUpdateAnimation, THDodgeCoolDown, animationTimer;

 FTimerHandle THResetCombo,THRUpdateAnimation, THDodgeCoolDown, animationTimer;


(inside my attack function)

 else if (isAttacking == true && AttackAnimationPlaying == true)
     {
 
         flipbookframe = GetSprite()->GetPlaybackPositionInFrames();
         
         if (numOfSwings < 2)
         {
 
             if (flipbookframe >= 7)
             {
                 
                 if (!GetWorldTimerManager().TimerExists(THResetCombo);)
                 {
                            GetWorldTimerManager().SetTimer(THResetCombo,this,&AWasabi_HorizonCharacter::ResetCombo, 10.0f, false);
                 }

...etc.. (its not calling ResetCombo)

I also have a dodge cool down in a similar way, and it works! but sometimes..it does not.

I followed it via break calls in VS2013 and found that TimerExists is always set as false( even when I set the timer number high and check to see. it always registers as false. ) so it's a weird not making it exist and probably making a few of these timers at the same time or resetting the timer every single time. I also want to mention how often this function gets checked.(through an Update Function). if I'm not updating the function(with the class variables that work globally not locally), it works fine, but, since I'm calling the function a few times .. that's where things get weird.

Before 4.9.1 it wasn't an issue or at least functioned in a way that did not outright give me this error. thought I'd call it in just in case. Please let me know if I'm a fool!

Product Version: UE 4.9
Tags:
more ▼

asked Sep 21 '15 at 02:06 AM in Bug Reports

avatar image

Demoneyejin
95 10 15 26

avatar image Demoneyejin Sep 21 '15 at 03:43 AM

I noticed that when I used another different TimerHandle variable it worked just fine. I have no clue why..Every TimerHandle worked except for the first one which ended up being my THResetCombo

avatar image Doug E ♦♦ STAFF Sep 21 '15 at 04:56 PM

Hey Demoneyejin-

Are you able to reproduce this in a new project without additional content? If so can you post the steps used to setup your timer and how it's being used in the editor?

Cheers

Doug Wilson

avatar image Demoneyejin Sep 21 '15 at 05:28 PM

I actually was un-able to replicate the bug. unfortunately on an empty project it seems to be working just fine. Even on its own or with multiple handle variables. I'll continue to see if I can replicate the bug from the game I'm working on in a cleaner source file for example.

Thank you, Alex Batista

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Hey Demoneyejin-

Are you still having problems using timers in your game or have been able to reproduce this in a new project? Let me know if you have any additional information about how the timers are not working properly. I will be marking this post as resolved for tracking purposes however feel free to add a comment to reopen it and we will continue to investigate.

Cheers

Doug Wilson

more ▼

answered Sep 29 '15 at 03:43 PM

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question