Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Change Direction of 2D Keyframe Animation

Discussion in 'Animation' started by AmmarO74, Mar 9, 2023.

  1. AmmarO74

    AmmarO74

    Joined:
    Apr 23, 2022
    Posts:
    4
    I am trying to create a recoil animation for a top-down 2d game. When the character shoots, I want them to recoil away from the shot direction which can be different from shot to shot.
    I can do this in code. But is such a thing possible using keyframe animations? Can I somehow pass a vector to my animation for it to adjust the direction of the movement?

    Thanks,