====== Playing effect with VCI script ====== === Example data === https://virtualcast.jp/products/90272cc2f7da5d797a31dd9bf67e840d73e91282d999144464a9379033bc3b90 ===== Configuration of objects and components ===== {{:vci:sdk:effekseer:effectsample.png?direct&600|}} ===== 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 [[en:vci:script:reference:effekseer | Effekseer (VCI script)]] for information on other VCI script.\\ The example can be used from[[https://seed.online/items/8450904ab8aac50b49a1dcb8cc844f655e70fbd9d149e83062342aade63f0d2e | EffectSample]].\\ -- 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