en:vci:sample:effect

Playing effect with VCI script

Example data

Configuration of objects and components

VCI Script

The basic way to use is to store the effect in a variable with vci.assets.GetEffekseerEmitter(“Name of an object with an effect attached”) and call the effect from the variable.
Refer to Effekseer (VCI script) for information on other VCI script.
The example can be used from EffectSample.

main.lua
-- Effects are acquired by specifying a name of GameObject with the effect component.
-- Store the effect attached to the GameObject named "Effect" in a variable "eff"
local eff = vci.assets.GetEffekseerEmitter("Effect")
local toggle = false
 
function onUse(use)
    -- Play the effect when the SubItem is being Used
    if use == "SubItem" then
        -- Reverse the toggle
        toggle = not(toggle)
 
        if toggle == false then
            -- Play the effect stored in the eff
            eff._ALL_Play()
            --Print the effect name being played
            print("Played an effect"..eff.EffectName)
        end
 
        if toggle == true then
            -- Stop the effect stored in the eff
            eff._ALL_Stop()
            --Print the effect name being stopped
            print("Stopped an effect"..eff.EffectName)
        end
    end
end
en/vci/sample/effect.txt · Last modified: 2023/05/11 20:16 by pastatto

Page Tools