Tuesday, 31 March 2015

Unity 3D: Using curves in inspectors

Today I took a quick jab at using curves in edit mode.
Chances are you already know these since they are commonly used to configure particle effects.

While primarily intended for animation, all you need is declare a parameter of type AnimationCurve and this gives you a nifty interface for parameter mapping. For example you could use it to relating the strength of an attack to resulting damage:

The built-in curve editor. Numbers are grey-on-grey and it 
doesn't seem possible to snap or input numerical values.

Although it isn't immediately obvious, it is possible to edit curves beyond the default [0,0] [1,1] range  (2-fingers gesture or wheel-scroll to zoom in/out).

Tips for working with curves

  • Don't use these where you don't need them. The curve editor isn't good enough to encourage abuse.
  • Bootstrap keyframes with meaningful values to help your designer.

No comments:

Post a Comment