timbibbs
timbibbs

Reputation: 317

How to make a line graph in the unity inspector

I've seen many questions asking how to make a line graph in the unity game-space, but not in the inspector. I wanted to make something sort of like this, but be able to put inputs in from a script.

Upvotes: 5

Views: 5298

Answers (1)

code11
code11

Reputation: 2309

I believe what you are looking for may be satisfied by unity's built in curveField. Theoretically it is meant for animation, but I've seen it used for things like motion profiles and complex interpolations.

What makes it better than a line graph is that it can be edited, either from the editor, or as you wanted, from a script using the AnimationCurve.AddKey method (you have to dig out the curve from the curveField)

Upvotes: 5

Related Questions