• Studio

  • Bots

  • Web API

  • Designer Resources

  • Host Resources

  • API

    Services

    Edit

    Time

    Provides controls over time-related aspects in your game Universe. It regulates the flow of time and pace of game actions, orchestrating object movements and animations.

    Properties

    deltaTime

    number

    ServerAndClient

    'deltaTime' represents the time in seconds it took to complete the last frame. It's useful for smooth object motion or time-related calculations, reflecting real-world time more than game time.

      self.Update:Connect(function()
        print("This frame took " .. Time.deltaTime .. " seconds")
      end)
    

    'fixedDeltaTime' signifies the time in seconds between physics updates (FixedUpdate calls). It's consistent between frames, crucial for physics calculations requiring stable performance.

      self.FixedUpdate:Connect(function()
        print("This physics step took " .. Time.fixedDeltaTime .. " seconds and will always take that long, unless manually changed")
      end)
    
    PocketWorlds Icon

    © 2024 Pocket Worlds. All rights reserved.