Difference between revisions of "Event: Script:OnUpdate"

From Nomad DB
(Created page with "This event is called '''every frame'''. Be careful performing heavy calculations here. {{WD2SH:ScriptEvent}} == Usage == <syntaxhighlight lang="lua"> OnUpdate() </syntaxhigh...")
 
Line 4: Line 4:
  
 
== Usage ==
 
== Usage ==
 +
=== WDL ===
 +
In Watch Dogs Legion, you can access the game & update time.
 +
 +
<syntaxhighlight lang="lua">
 +
function script:OnUpdate(time, dt)
 +
-- time = Game Time
 +
-- dt = Delta Tiem
 +
end
 +
</syntaxhighlight>
 +
 +
=== MDE & WD2 ===
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
OnUpdate()
 
OnUpdate()

Revision as of 21:53, 14 April 2021

This event is called every frame. Be careful performing heavy calculations here.

Registration

This event is registered on the Script Table.

Usage

WDL

In Watch Dogs Legion, you can access the game & update time.

function script:OnUpdate(time, dt)
	-- time = Game Time
	-- dt = Delta Tiem
end

MDE & WD2

OnUpdate()

Related Pages