Weexer Posted December 4, 2017 Share Posted December 4, 2017 (edited) 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 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 December 5, 2017 by Weexer Link to comment Share on other sites More sharing options...
Weexer Posted December 5, 2017 Author Share Posted December 5, 2017 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... Works perfectly Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now