You have to set them up manually with events, and it all depends on the design of your game. It could get complicated depending on what you want. Something like "fence hop", for example, would require a variable which increments, for a sort of timeline. First, it would freeze the player movement, then it would detach the animation sprite, play the animation and possibly move it over the fence (timed with the animation), then snap the hitbox back to the animation sprite. Like I said, it's really specific and depends on the design of the game. Something like I just described would give a prince of persia (not the 3d one, the old one) type of feel. Maybe you just want the animation to play when the player actually just walks over the fence. In that case you would just set the animation when the hitbox is over the fence. Think about what you want, and try to implement it.