Hi, I am working on a 2D topdown view game. I have frame by frame animations. But, since whole body is just a one png file, I cannot manage situations like punching, stabbing etc. Because I cannot access “the hand” particularly since hand position is always changing but collider remains same. Thanks for help.
You could add child Game Objects with colliders on them, then animate them as the parent sprite changes. You can animate child objects from a parent object.
Like PGJ said you need to create separate child game objects to animate them separately, you could edit your sprite PNG in something like GIMP to get each body part by itself so you can create an object for each in your game.
Actually, you don’t have to cut the sprites apart. Add the collider to a child object (this is to make it easier to detect which collider collided). Then, in the parent’s sprite animation, add a transform animation for the child object and move the child object/collider to the appropriate position for each sprite frame.
PGJ I didn’t fully understand what you meant in your first comment, but that is a much easier solution than mine! I like it