Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Can I clamp an AnimationCurve editor window to specific bounds ?

Discussion in 'Animation' started by mslinklater, Nov 28, 2014.

  1. mslinklater

    mslinklater

    Joined:
    Mar 1, 2013
    Posts:
    44
    Hi - We use AnimationCurve values for a lot of our gameplay tweak values. Whenever our designers click on an AnimationCurve to edit it the window which appears is clamped to the extents of the values in the curve. Is there a way to clamp to range to a different value ? Our designers are going bonkers having to constantly reset the zoom levels on the axes.

    Thanks.
     
  2. OllyNicholson

    OllyNicholson

    Unity Technologies

    Joined:
    Jun 17, 2011
    Posts:
    142
    Hi - you can use the middle mouse to zoom in and out and F to re-frame the curves, but at the moment there is no range value that can be set, to the best of my knowlegde - have it put on feedback and try and get it voted on as much as possible ;-)

    http://feedback.unity3d.com/
     
  3. RealSoftGames

    RealSoftGames

    Joined:
    Jun 8, 2014
    Posts:
    220
    sorry to open an old thread but has this been achieved yet. i am after something very similar i would like to clamp the values of an animation curve.
     
  4. Sycoforge

    Sycoforge

    Joined:
    Oct 6, 2013
    Posts:
    676
    You can create a custom editor and clamp the curve there. The example below clamps the curve to a normalized range ([0, 1]) in x- and y-direction.

    Code (CSharp):
    1. data.Mask.Curve = EditorGUILayout.CurveField(data.Mask.Curve, Color.red, new Rect(0, 0, 1, 1));
     
unityunity