Search Unity

Question Help needed - 2D sprite animations (keyframe recording)

Discussion in 'Animation' started by Maticy, Nov 3, 2020.

  1. Maticy

    Maticy

    Joined:
    Aug 23, 2020
    Posts:
    1
    I'm a beginner in Unity working on animations for my player and everything seemed to be working just fine, until I came across this problem;

    so when my player attacks right, the right hitbox should activate, whenever he attacks on the left side, the left hitbox should activate and so on...
    I tried to do this by using keyframe recording mode but instead of only one hitbox activating, all of them get activated at once and I'm not sure why. It's weird because all my animations for walking, attacking are working properly. So if I attack right side, the right attack animation will play just the way it should - no problems at all. I tried doing this with another simple object. I had it deactivated, and I wanted to activate it when, let's say, our player does right attack - it would get activated even if I did left, top or down attack. I'm not sure why.

    I don't know what exactly am I doing wrong - I'm using the keyframe recording mode the way it should - and when I'm previewing the animations in animator it looks fine as well. So I'm wondering how are the hitboxes not working the way they should if the attack animations get played properly? Cause I did the keyframe recording on the same layer so it would be logical to be working fine, but it's not.
    (I'm using Unity 2019.4.13.f1)

    Any help would be greatly appreciated.