Does the Delta Time plugin still work?

I’ve download and activated the plugin.
I’ve included the right information in the build settings as well as the syntax


but I keep getting a " module ‘plugin_deltatime’ not found: " error

is it working for anyone else?

Are you using Corona builds or Solar2D builds? If you’re using Solar2D builds, Corona Marketplace doesn’t work with them.

You can try this alternative that I found through Google search: https://github.com/ldurniat/delta-time

1 Like

Pretty sure I’m using Solar2D builds. The strange thing is this plugin works - https://marketplace.coronalabs.com/corona-plugins/calendar and I’ve downloaded it from the same marketplace.

I can’t find the build settings-plugin code in the link you sent

This is an in-house plugin so it’s baked into the offline builds, locally available on your computer.

The code I sent you is an open source library which you can include right in your code and use right away. You can check out the example: https://github.com/ldurniat/delta-time#example

You can also use my delta time module.

deltatime.lua

local M = {}

M.dt = 1

local frame = 1000/display.fps
local getTimer = system.getTimer
local prev

local function _update()
    local new = getTimer()
    M.dt = (new-prev)/frame
    prev = new
end

function M.start()
    prev = getTimer()
    Runtime:addEventListener( "enterFrame", _update )
end

function M.stop()
    Runtime:removeEventListener( "enterFrame", _update )
    M.dt = 1
end

return M

You can use the delta time in your project via:

local dt = require("deltatime")
dt.start()

Runtime:addEventListener( "enterFrame", function()
    print( dt.dt )
end )

Basically, once you’ve required the module and called .start(), then you’ll be able to access the delta time value via dt.dt in whatever file you’ve required it from. Then, if you ever stop the module, it’ll still keep your game from crashing.

By the way, Corona Marketplace is obsolete for Solar2D builds. You can use alternatives found here: https://github.com/coronalabs/corona#plugins-for-all-needs
or directly reference third-party plugins like in here: Plugins for New OFFLINE builds 3595

@bgmadclown, I’ve never downloaded plugin code before (knowingly), so if I download those plugins, where do I put them on my system? (Mac)

Not entirely sure because I haven’t tried it yet but this may work - https://docs.coronalabs.com/native/hostedPlugin.html#solar2d-simulator-and-builds

For example, Vungle plugin works like this in Windows: Under Simulator/Plugins there is a folder named plugin.vungle and there is a data.tgz file inside. It should be similar.

Does anyone know if we should download plugins and place them in the Simulator/Plugins folder on Mac and/or PC, with regard to the new offline version 3600?