C4 Engine Terathon Software C4 Engine API Documentation

• Controller System

API Links
Developer Links

Controller::Activate

Defined in:  C4Controller.h
Called when a controller is activated by some kind of trigger.
Prototype

virtual void Activate(Node *trigger, Node *activator = nullptr);

Parameters
trigger A pointer to the node that caused the controller to be activated. This can be nullptr.
activator The node that activated the trigger. This can be nullptr.
Description
The Activate function is called when some kind of trigger in the world causes a controller to be activated. This function can be called because a Trigger node was activated, or it can be called by a script. A controller subclass may perform whatever action is appropriate in response to the activation.

The default implementation performs no action, so any override of the Activate function does not need to call the base class counterpart.
See Also

Controller::Deactivate

World::ActivateTriggers

Trigger