Search Unity

Bezier curve animation

Discussion in 'Animation' started by MichelTardis, Oct 17, 2018.

  1. MichelTardis

    MichelTardis

    Joined:
    Dec 3, 2014
    Posts:
    3
    Hi I want to know how can I design an animation which use a bezier curve for value interpolation? I checked the AnimationCurve but it does not allow me to add some control points to form a bezier curve. What I want to do is to create some custom animation which is controlled by a bezier curve like on android platform. If someone knows the way, please tell me. Thanks in advance!
     
  2. PGJ

    PGJ

    Joined:
    Jan 21, 2014
    Posts:
    899
    Maybe, I misunderstood your problem... But, you can add points to and Animation Curve. Just double click on the curve and a control point will be added.
     
  3. RichardKain

    RichardKain

    Joined:
    Oct 1, 2012
    Posts:
    1,261
    Yes, the AnimationCurve class is essentially a Bezier curve, with all the options that implies. You can adjust the handles for individual points on the curve, make them hard stops instead of smooth. You can even create and edit an animation curve through programming. (I've done this in the past for some of my projects, and it worked like a charm) The visual editing in the Unity interface should allow you to do whatever you want as far as manually editing the curve is concerned. Poke at it a little and you should find what you need.
     
  4. MichelTardis

    MichelTardis

    Joined:
    Dec 3, 2014
    Posts:
    3
    I tried editing control points of AnimationCurve, but it did not work as I expected. What I want is to use a curve like this:http://cubic-bezier.com/#.17,.67,.83,.67

    Thanks for your reply, finally I solved this problem by writing the curve in the script.