Download

Flipbooks and sockets issue

Anyone else experienced with spawning a flipbook on a socket? My weapon spawns perfectly in the socket and the flipbook will play fine and both my character attack that has the sockets and the flipbook for the weapon are exactly the same so basically it does work fine. Until I spam the attack button. Currently I have the on finished playing destroy the attached actor to remove the weapon at the end and it does work. Then AFTER it destroys the already spawned actor I have it set to allow a second attack. Basically yes there is a cooldown so it will not allow you to fire a second attack before the first finishes and the spawned actor on the socket has been destroyed. Yet when I attack as fast as I can it will spawn the actor at the characters feet for the very first frame then it snaps to the socket and plays out the rest of the way fine. What I don’t understand is why the actor spawns fine when I attack slow. So basically I need a way to control this better without adding more delay to the players ability to attack. I tried getting the socket location of the sprite and feeding it into the location for the transform when spawning the actor it had no effect.

Found it. The actor cannot be attached to the socket when I am attaching it. Basically the Actor was able to spawn just fast enough to beat the socket being present. So before the first frame of the attack would play which contains the first socket the actor would spawn and then snap to the very next frame present with a socket. Because of how close this all was I didn’t even realize I was spawning the actor before the flipbook with socks was being played. Also explains why it only happened if I spammed attack even with a cooldown on it.