local assets =
{
    Asset("ANIM", "anim/cane_shadow_fx.zip"),
}
local MIN_SCALE = 0.7
local MAX_SCALE = 1.1
local names = {"shad1","shad2","shad3"}
local scale = math.random(MIN_SCALE,MAX_SCALE)

local function fn(Sim)
    local inst = CreateEntity()

    inst:AddTag("FX")
    inst:AddTag("shadowtrail")

    inst.entity:AddTransform()
    inst.entity:AddAnimState()
    inst.AnimState:SetBank("cane_shadow_fx")
    inst.animname = names[math.random(#names)]
    inst.AnimState:SetBuild("cane_shadow_fx")
    inst.AnimState:SetScale(scale,scale)
    inst.AnimState:SetMultColour(1, 1, 1, .5)
    inst.AnimState:PlayAnimation(inst.animname)

	inst.entity:SetCanSleep(false)
    inst.persists = false
    inst:ListenForEvent("animover", inst.Remove)
	inst:DoTaskInTime(1.5, inst.Remove)
    return inst
end	
return Prefab( "venus_butterfy_fx", fn, assets)