Search Unity

Limitation with Animation Curves?

Discussion in 'Animation' started by Cato11, Nov 21, 2021.

  1. Cato11

    Cato11

    Joined:
    Jan 5, 2021
    Posts:
    233
    I am trying to move an object in a curved path. Initially I have tried formulating the path by creating my own bezier curve, as shown below (yellow line is the target path, pink and red dots are the control points):

    Untitled.png

    However, I now believe it will be easier for me to create this path using Unity's built in Animation Curves. The reason being that I need to accelerate the body as it follows this path. So by using an Animation Curve, it should be easier to calculate the area under the curve to find the time of the motion.

    The problem I have is that Animation Curves appear to not allow this type of shape, i.e. where the end of the curve swoops outwards and back in before ending, kind of like a question mark. Please see below:

    Untitled1.png
    Essentially I need the green line to be more like a question mark, as the yellow path does. The final point should be lower along the x-axis than the outer bulge, as shown in the rough sketch beside it. But if I try to drag the end point inwards, the curve reformats and becomes a real mess!

    Does anyone know if it is possible to create a curve like this? It seems like a pretty basic requirement.
     
  2. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    396
    Last edited: Nov 22, 2021
    SolidAlloy likes this.
  3. Cato11

    Cato11

    Joined:
    Jan 5, 2021
    Posts:
    233
    Hmm yes, that is a fair point! I suppose you're right when looking at it as a graph.

    I've tried to avoid using third party libraries since I prefer to write my own code, as I prefer to understand how everything works. In fact I am quite new to Unity and have never made use of extensions before.

    If I was to use the tool you provide, can I include it as part of my own released game? Or am I obliged to pay some kind of royalty? I realise this is more of a legal question vs. an animation one, but any pointers would be great.
     
  4. razzraziel

    razzraziel

    Joined:
    Sep 13, 2018
    Posts:
    396
    There is a License section on that link explains that. Mostly open source projects are free to use.