This page has been translated automatically.
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Setting Up Development Environment
Usage Examples
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
Double Precision Coordinates
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Running Tracks in Application

After the track-based animations were created in UnigineEditor, they need to be played in the application. To add this functionality to your project, add the following code into the world script:

Source code (UnigineScript)
#include <core/systems/tracker/tracker.h>

Unigine::Tracker::TrackerTrack track;
float time, min_time, max_time, unit_time;

int init() {

	// use the Tracker namespace
	using Unigine::Tracker;

	// create a Tracker instance that will play the tracks
	Tracker tracker = new Tracker();
	// load the required tracks from a file
	track = tracker.loadTrack("samples/tracker/tracks/render_00.track");
	// get the start time of the track (in units)
	min_time = track.getMinTime();
	// get the end time of the track (in units)
	max_time = track.getMaxTime();
	// get the duration of the track unit (in seconds)
	unit_time = track.getUnitTime();
	// set the initial time to play the tracks
	time = track.getMinTime();

	return 1;

int update() {
	if(track == NULL) return 1;
	// update the tracks animation time
	time += / unit_time;
	time = min_time + ((time - min_time)) % (max_time - min_time);
	// set animation time for tracks
	if( track.set(time);
	return 1;
Last update: 2019-08-16
Build: ()