Announcement

Collapse
No announcement yet.

Displaying timers in minutes and seconds

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

    Displaying timers in minutes and seconds

    Is this possible? If so, can someone explain how to set it up? I see the timer node, but it only gives the option for seconds. I am probably overthinking it, but can't figure out how to set it for minutes as well.

    #2
    Hi, can you please elaborate your issue a bit more I am not really sure what your problem is?

    Comment


      #3
      I am trying to create a timer that will display on screen during the game level that will count down in seconds. But, instead of setting it to 90 seconds, for example, I want it to show 1:30.

      Comment


        #4
        ta daah!

        Click image for larger version

Name:	time.JPG
Views:	1
Size:	91.1 KB
ID:	1108246

        I convert to text for use in the Hud

        i use diferent text widget for each date.

        Click image for larger version

Name:	hud.JPG
Views:	1
Size:	96.1 KB
ID:	1108248
        Last edited by DomusLudus; 06-14-2016, 02:29 AM.

        Comment


          #5
          Give this a go.

          Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	225.3 KB
ID:	1108247
          Im an Moderator on UnrealSlackers Discord! Which is a Community driven group of likeminded people here to discuss UE4! Join UnrealSlackers on Discord!

          Comment


            #6
            Awesome! Thanks! I will try this out.

            Comment


              #7
              Originally posted by DevilsD View Post
              Give this a go.

              [ATTACH=CONFIG]97588[/ATTACH]
              Do I put this in a text bind or separate function? I tried both ways, and neither display my timer on screen.

              Comment


                #8
                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?

                Comment


                  #9
                  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.

                  Comment


                    #10
                    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.

                    Comment


                      #11
                      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.

                      Comment


                        #12
                        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.

                        Comment


                          #13
                          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.

                          Comment


                            #14
                            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.

                            Comment


                              #15
                              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.

                              Comment

                              Working...
                              X