Search Unity

Animation mirror

Discussion in '2D' started by Nico13240, Apr 21, 2022.

  1. Nico13240

    Nico13240

    Joined:
    Jan 20, 2022
    Posts:
    1
    Hello everyone,

    I use the 2D engine, to create a beat them all

    I have a question about the mirror effect of an animation.

    I created a gameObjet (a box) and place it on the stage.
    I created an animation for this box. The box falls on the right when the player is on the left and hit it (logic)
    However, when my player is on the right and hit this box to the left, it always falls to the right, which of course doesn't make sense.

    Several choices obviously exist but if other methods, do not hesitate:

    - Either I create another animation with the box falling on the left (I would not like to use this process because too many gameObjects in this same case
    - Either I try to play with the methods animationClip.SetCurve, animationcurve and others directly in the script (if I understood correctly). Apparently, this remains the most "complex". I couldn't find a specific example...
    - Either I would like to use the "Mirror" checkbox directly on the animation (tried, didn't work, can you help me on this and if this checkbox is good for that?)

    Thank you.

    I have version 2020.3.14f1 Personal
     
  2. DanielTanBK

    DanielTanBK

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    82
    Hello,

    With just the information above its hard to tell what the problem is.
    Do add a video clip or create a bug report with your project attached for us to take a look.