This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
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
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
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
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
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.

Switcher

Switcher is an object that disables or enables its child nodes at a specified distance from the camera. Possible use cases are:

  • Enabling one object and disabling another at a specified distance
  • Disabling an object while moving away
  • Enabling an object while approaching

Each object is composed of Switcher and two spheres of different colors

See Also#

Adding a Switcher#

To add Switcher to the scene via UnigineEditor, do the following:

  1. Run the project with UnigineEditor.
  2. On the Menu bar, click Create -> Optimization -> Switcher.

  3. Place the node somewhere in the world.
  4. Make the node that will be controlled by Switcher a child of the latter.
  5. Specify the enabling and the disabling distance in the Switcher parameters.

Switching between Two Objects#

To switch between two object at the specified distance (like shown in the picture above), do the following:

  1. Create a Node Dummy for convenient grouping.
  2. Make the first Switcher the child of the Node Dummy.
  3. Make the first object the child of the first Switcher and specify its maximum visibility distance.
  4. Make the second Switcher the child of the Node Dummy.
  5. Make the second object the child of the second Switcher and specify its minimum visibility distance.

Notice
To make objects switch at the same point, the maximum visibility distance of the first one and minimum visibility distance of the second one should match.

Switcher Parameters#

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

Node tab of the WorldSwitcher node
Min Distance The minimum distance of visibility, in units. If the camera is closer to a node than this minimum distance, the node is not visible.
Max distance The maximum distance of visibility, in units. If the camera is further from a node than this maximum distance, the node is not visible.
Last update: 2023-06-23
Build: ()