This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Animations-Related Classes
Containers
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
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

World Trigger

A world trigger is a cuboid shaped object, which triggers events when any node (physical or not) gets inside or outside of it. The trigger can detect a node of any type by its bound object and can be used to access node's components and parameters.

Notice
Some "abstract" objects do not have bounds; therefore, they do not interact with World Trigger (regardless of the Triggers Interaction option state):

World Trigger affecting meshes

See also#

Creating a World Trigger#

To create World Trigger via UnigineEditor:

  1. On the Menu bar, choose Create -> Logic -> World Trigger

  2. Place the node in the scene.

Editing a World Trigger#

In the Node tab of the Parameters window, you can adjust the following parameters of World Trigger:

Node tab of the World Trigger node

Bounding Box Parameters#

A set of bounding box parameters:

Edit Size

Toggles the editing mode for the World Trigger node on and off. When enabled, the bounding box sides that can be resized are highlighted with the colored rectangles. To change the size of a side, drag the corresponding rectangle.

Touch Toggles the touch mode for World Trigger on and off. With this mode on, World Trigger reacts to the node at a partial contact. Otherwise, World Trigger reacts only if the whole bounding box gets inside it.
Size The size of the World Trigger bounding box along the X, Y, and Z axes, in units.

Handling Events#

To perform specific actions when a node enters or leaves the World Trigger, you should implement event handlers that receive a Node as the first argument. Then, you should subscribe to the Enter and/or Leave events and call connect().

Source code (C++)
// subscribe to the Enter event when a node enters the world trigger with your handler
worldTrigger->getEventEnter().connect(enter_event_handler);
// subscribe to the Leave event when a node leaves the world trigger with your handler
worldTrigger->getEventLeave().connect(leave_event_handler);
Source code (C#)
// subscribe to the Enter event when a node enters the world trigger with your handler
worldTrigger.EventEnter.Connect(enter_event_handler);
// subscribe to the Leave event when a node leaves the world trigger with your handler
worldTrigger.EventLeave.Connect(leave_event_handler);
Last update: 2024-08-16
Build: ()