15.Let's Send triggers to change effects!

概要

This chapter explains the trigger function of Effekseer. The trigger function can change effects during playback.

For example, as shown in the following example, a weapon that is being charged with energy can be triggered to fire.

Double-click to send the trigger.

Trigger function

Trigger is a mechanism that allows up to four triggers to be sent to the effect currently playing. The triggered effect can change its behavior according to the parameters set in the node.

Trigger settings

The behavior change by the trigger is set in Common.

Common panel trigger settings

Sending triggers from the editor

Triggers can be sent from the controller panel.

0,1,2,3 button to send triggers

Send triggers from the game

There are APIs to send triggers to SDKs and plug-ins for each game engine.

sample effect

This chapter explains using the sample file TriggerLaser.efkefc.

Node configuration for the effects created in this chapter

When an effect is played, the following actions are performed.

  • Charge node particles are generated and child node particles continue to be generated.

  • Laser node particles are not generated.

When trigger 0 is sent to the effect, the following operation is performed.

  • Charge node particles are deleted and particle generation in child nodes stops

  • Laser node particles start generating and child node particles are also generated

Node to delete particles when triggered

Trigger settings for Charge node

Node that starts particle generation when a trigger is sent

Trigger settings for Laser node

Tips

Particles deleted by a trigger may disappear instantly, which may be unnatural. In this case, you can set Fade out after delete to make them disappear naturally by fading out.

Fade-out behavior

In Fade out within lifetime, the particle is faded out by deletion due to lifetime, but not by deletion due to trigger. In both of the following examples, the particles are deleted by the trigger, but the fade-out behavior is different.

Fadeout within lifetime

Fadeout after destroyed

Summary

This chapter explained how to use triggers. Take advantage of triggers to create interactive effects.