Skip to content

Less3Design/L3-curveClip

Repository files navigation

Frame 296

vibed with codex 5.5

Usecase

Created this for situations where you want to give something an animation, but animation clips and animators felt too bulky.

Jiggle an object in a satisfying way when the player hovers it.

This is great for that.

Recording.2026-06-05.195552.mp4

Editor

The object is just a handful of animations curves, so the main lift was creating a nice editor to make authoring these curves not such a chore.

I tried to have roughly the same feature set as the multi-curve-editor featured in Unity's particle systems.

Usage

You can play the curves targeting a transform.

public CurveClip clip;
public CurveClipPlayback playback;

public void ThingHappened()
{
    playback = clip.Play(transform);
}

public void CancelTheThing()
{
    playback.Cancel()
}

You can play multiple clips on a single transform and they will additively mix.

public void CancelAllClips()
{
    CurveClip.Cancel(transform);
}

It's important to note that position can't be normalized across objects as simply as rotation & scale. How should a bounce on the Y axis behave across many differently size and shaped objects?

For this a few methods to scale the position curves are provided.

// scale the position curves by a flat value
clip.Play(transform, 2f);
// scale the position curves individually
clip.Play(transform, new Vector3(1f, 2f, 1f));
// scale the position curves based on the bounds of a renderer
clip.Play(transform, renderer);
// scale the position curves based on the bounds of all renderers on a gameObject
clip.Play(transform, gameObject);

Performance

About

One-shot curve animations for Unity

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENSE.meta

Stars

Watchers

Forks

Contributors

Languages