Jump to content

Problem with KillFX


Recommended Posts

Hello , I have problem with killing fx of spawned prefabs, here's piece of my code. Could anyone help me by giving me some tips how to do "Kill animation" working? - i don't ask for straight code :wilsconnivingsmile: I want to learn it. Maybe You know about some lua files where i can look into? (PS. everything works without last line - DoTaskinTime)

		local x, y, z = target.Transform:GetWorldPosition()
			SpawnPrefab("lightning").Transform:SetPosition(x, y, z)
			SpawnPrefab("deer_ice_circle").Transform:SetPosition(x, y, z)
			SpawnPrefab("deer_ice_burst").Transform:SetPosition(x, y, z)
			SpawnPrefab("deer_ice_flakes").Transform:SetPosition(x, y, z)
			inst:DoTaskInTime(4, SpawnPrefab.KillFX) -- Here is the problem! <-- Is there any other ways to do that?

 

Edited by Weexer
Link to comment
Share on other sites

		local x, y, z = target.Transform:GetWorldPosition()
		local spell = SpawnPrefab("lightning")
		spell.Transform:SetPosition(x, y, z)
		spell:DoTaskInTime(4, spell.KillFX)
		local spell2 = SpawnPrefab("deer_ice_circle")
		spell2.Transform:SetPosition(x, y, z)
		spell2:DoTaskInTime(4, spell2.KillFX)
		local spell3 = SpawnPrefab("deer_ice_burst")
		spell3.Transform:SetPosition(x, y, z)
		spell3:DoTaskInTime(4, spell3.KillFX)
		local spell4 = SpawnPrefab("deer_ice_flakes")
		spell4.Transform:SetPosition(x, y, z)
		spell4:DoTaskInTime(4, spell4.KillFX)

Got it after few tests... :wilson_sneaky: Works perfectly

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...