Announcement

Collapse
No announcement yet.

Displaying timers in minutes and seconds

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    This is a great thread guys!

    I hate to revive a close topic, but, I am trying to make the seconds not go pass 60 and returning back to 00 and starting the count again.
    I am having trouble to get that to work.

    Would appreciated any sugestions.

    Thanks

    Leave a comment:


  • replied
    I use a timer https://docs.unrealengine.com/latest...rs/Blueprints/

    Use Tick is a bad habit.

    Leave a comment:


  • replied
    One more question. Is there a way to pause the clock while looking through inventory windows? I tried using a bool to tick the clock on and off, but it seems to always set it back to zero when the game is paused. When I come back into the game, it says game over, even though the timer is running again, and there is clearly time left on the clock.

    Leave a comment:


  • replied
    Ah, nevermind. I had my clamp connected wrong. Got it working now. Thanks again for all your help!

    Leave a comment:


  • replied
    The problem appears to have been the return value was not named "Return Value." It is displaying the text now, and converting it properly.

    One more question, though. How do I set up the clock to NOT go below zero?

    Leave a comment:


  • replied
    Okay, just to be clear, so when you set it to bind, is it fails to display any text at all (like the 'seconds' variable's value without converting), or is it only happening when you process the 'seconds' variable and convert it to minutes and seconds?

    If you cannot display any text at all in the binding function, I think that is a bug then.

    EDIT:

    I see you managed to fix it. Good luck!

    Leave a comment:


  • replied
    Yes, that fixed it! Thanks!

    Leave a comment:


  • replied
    It would help if you showed some more images, like your widget design and the binding in the details panel.

    However, I believe there used to be a limitation with UMG bindings, which may still be the case, where the name of the output parameter of the function you bind had to be the default 'ReturnValue'. As I remember, any other name and it would just silently fail. I would guess that may be your problem.

    Leave a comment:


  • replied
    Originally posted by Kontur View Post
    Can you make any text to display at all? Try to output some text from this functon does that work? Also, check if the function is still binded to the text, because it unbinded itself for me a couple of times in the past.
    When it is not being binded, it displays (but doesn't count down). But once it is set to bind to this, it diesappears. I tried deleting the text block and recreating it, and still no luck.

    Leave a comment:


  • replied
    Can you make any text to display at all? Try to output some text from this functon does that work? Also, check if the function is still binded to the text, because it unbinded itself for me a couple of times in the past.

    Leave a comment:


  • replied
    Click image for larger version

Name:	TimeBind.png
Views:	1
Size:	239.2 KB
ID:	1108633

    Ok, changing it to a variable fixed the compiling issue, but it still does not show up when I test play.

    Leave a comment:


  • replied
    There are several issues. First, I think binding functions cannot take inputs, so you will need to get the 'Seconds' from a variable, or by casting from the function. Second, you did not setup your graph correctly. There is nothing plugged into the modulus node, and you compare your integers against 0 instead of 9.

    Leave a comment:


  • replied
    Click image for larger version

Name:	TimeBind.png
Views:	1
Size:	243.7 KB
ID:	1108631

    Sorry, just noticed the one float wasn't connected, but same result.

    Leave a comment:


  • replied
    Click image for larger version

Name:	TimeBind.png
Views:	1
Size:	305.3 KB
ID:	1108630

    When I do it in the text bind, I get the error in the message log. When I call it as a function, nothing renders at all for the timer.

    Leave a comment:


  • replied
    Originally posted by AJJepson View Post
    Do I put this in a text bind or separate function? I tried both ways, and neither display my timer on screen.
    Hi,
    Do you have issues with displaying the value at all, or with the displayed value, because the conversion that [MENTION=25924]DevilsD[/MENTION] provided should work correctly. You can either make this setup in the text bind function, or if you are planning to use it later on in different classes, you can also make a function of it in a Blueprint Function Library, so you will be able to call it anywhere.

    Can you please post a screenshot about your current text binding function, so we can have a look?

    Leave a comment:

Working...
X