- Home /
2D animation collision
i've looked around but i really can't find an answer this.
lets say i want to make a fighting game, and there is a sprite animation that involves the character extending his arm to punch. My question is: how exactly would i go about making that arm have its separate collider during the animation? I know there are a lot of fancy frameworks out there like 2d toolkit, ex2d, sprite manager, etc but i can't find any specific info or tutorial that focuses on this type of interaction.
there is really no way to do this now? there has to be. I haven't seen a 2D fighting game yet but i know there are other 2D Unity games with some form of melee combat that would require something like this.
Hey did you find any solution yet? Im also looking for similar solution for my game
Answer by DFledermaus · Oct 24, 2013 at 12:53 AM
You'd do this like any other time you generate a temporary collider, look here under anything that ends in "cast" like linecast or capsulecast. You'll have to match it's position and size to your animation by hand.
Unless you need an actual collider and not just a trigger, that would be a sub-object that you enable and animate when needed and keep disabled the rest of the time. But for a fighting game you probably don't need this type.
ill try this. i thought raycasts and the like were mainly used for projectiles.