Announcement

Collapse
No announcement yet.

Total time game played?

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

    Total time game played?

    How do I get total time game played output to the log on quit?

    #2
    In your GameInstance/GameMode/GameState class simply create a float variable called "timePlayed"

    in the Event Tick of this class, add the delta Seconds to this timePlayed.

    When quitting, simply print this timePlayed.
    You may format this variable to seconds, minutes, hours and days.

    Comment


      #3
      Originally posted by Raildex_ View Post
      In your GameInstance/GameMode/GameState class simply create a float variable called "timePlayed"

      in the Event Tick of this class, add the delta Seconds to this timePlayed.

      When quitting, simply print this timePlayed.
      You may format this variable to seconds, minutes, hours and days.
      Thanks for that Raildex, but could you please show me what you mean as a BP and could this be done simply from the level BP?

      Comment


        #4
        Create a blueprint from the GameMode/GameInstance/GameState class and do what I just wrote.
        The GameMode atleast provides a function called "PostLogout" or something simlar(just search for "Logout") that executes when the Player disconnects/quits the game.

        Comment


          #5
          A simple search on google would have given you this:

          https://answers.unrealengine.com/que...-playtime.html
          Open for contracted work | C++/BP (incl. Multiplayer) | Tutoring | VR

          My UE4 Blog/Page with Tutorials and more: Hit me for ALL the things!
          (Including 100+ Pages Multiplayer Network Compendium to get you started.)

          Comment


            #6
            Originally posted by eXi View Post
            A simple search on google would have given you this:

            https://answers.unrealengine.com/que...-playtime.html
            It clearly didn't otherwise I wouldn't have posted, but thankyou anyhow.

            Comment

            Working...
            X