Page tree
Skip to end of metadata
Go to start of metadata



Introduced in

Version:3.2

Description

Description:

Execute the defined command code, once per frame (even when the game is paused).

The code executes synchronously, and cannot contain any sleep or waitUntil commands.

If a new onEachFrame command executes, while a previous one is still active, then the previous one stops.

Note: The command does not work with draw commands (for example, drawLine).

Syntax

Syntax:onEachFrame command
Parameters:
  • command: Code or String - Command to execute. To stop execution, call with empty code: onEachFrame {}
Return Value:Nothing

Examples

Examples:
Execute the code every frame:
onEachFrame "player sidechat str time"
Execute the code every frame:
onEachFrame {[] execVM 'frame.sqf'}
Stop execution:
onEachFrame {}

Additional Information

See also: 
Multiplayer: 
Problems: 

Notes