I hope that everyone is well, I come to you with what I hope is a super quick questions. I want my character to attack, this will have a factory create the projectile. This projectile has a flipbook animation showing it increase in size. When it is at full size (in other words, when it is done with the animation) I want to to then switch to another animation group. I couldn’t quite figure out how to do this with
animation_done since the factory was created through the player script. Here is my code…
if message.id == hash("attack") and message.released and facingright and onground and canattack then print("attack recieved") print("attackright") local pos = go.get_position() + vmath.vector3(160, 30, 0) local id = factory.create("#attack", pos) go.animate(id, "position.x", go.PLAYBACK_ONCE_FORWARD, pos.x + 1000, go.EASING_LINEAR, 0.8, 0, function() go.delete(id) end) canattack = false timer.delay(.5, false, function() canattack = true end) end
Any insight would be appreciated, if I need to reword anything, please let me know!
All the best,