I use AnimationCurves to simulate climate, average temperatures over the year, moon phases, wind strength, blending and even keyframing the generated weather to vary rain and wind. Then I use this info to calculate dewpoint and evaluate that combined with our temperature and humidity to determine fog. AnimationCurves are awesome indeed.
i was about to say recently i have used curves to make a blinking star effect simply by changing its size .i was really proud tough but then i see you simulate conditions of an entire planet.
I saw that animation curve in the particle system and wanted to use in normal scripts but never knew the name of it, and how usefull they are... thanks!
This is a great way to get a somewhat normal distribution! If you evaluate a random float on the interval from 0 to 1 then make the curve look like a zoomed in cubic function with an origin at (.5, avg). Depending on what you are going for the extremities can be around four standard deviations from the mean. This can be used to determine the average health of a enemy, but give it some variety upon instantiation. A better example would probably be tree height in a well developed forest. Thanks for the tutorial! I would have never thought of using animation curves for other purposes.
I didn't expect animation curve to be this much useful I'm always lazy to watch videos to learn something new in unity. But you always prove me it worth doing it ❤️
Wow, this video blew my mind. I never would have thought to use animation curves this way and it seems super useful! I'm excited to try this out with a future project of mine. Thanks, Code Monkey!!
Very nice! Using animation curves I prefer to clamp the curve within range of [0,1] on both axes, and send/apply its evaluation to normalized values. Advantage would be simpler configuration adjustments just from the class or scriptableObject, afterall it's just the curve shape we're interested in, not the values it posses.
I find it great that it can support both! I used the same values as in the logic to keep the video simple but yup if I was making this in a proper game I would probably end up normalizing the graph.
Thanks for the awesome vid! Definitely going to start using them more! Although for your last example where you evaluate the curve at each index I would probably prefer to just make a serializable struct or scriptable object called "WaveInfo" that has an int for amount of enemies and an int for enemy health. Then you could just have a WaveInfo array on the spawner and set the stats for each wave in the inspector. I think that would feel more intuitive than matching two different curves for each wave
You literally saved my game jam game, man you're THE BEST! Waiting for your Xcom game style course to grab it! Learnead a lot from your builder defender course! Keep going ^^
AM SO FUCKING GLAD I CLICKED ON THIS I THOUGHT I WAS GONNA HAVE TO INTERGRATE MY ACCELERATION FUNCTION AND THEN HAVE TO REINTEGRATE EVERYTIME I WANTED TO CHANGE THE FEEL OF THE ACCELERATION CURVE. btw the shooting in ur game looks so fucking fun
Oh, ive been using gradients in the way you use the curves, a lot more easy to understand with curves tbh, but i didnt know about them so... i adapted with the things i knew
I use animation curves to modify terrain generation and image filtering. I didn't even consider them for the longest time. Wish they were just called curves.
I have few questions about the animetion cocurved 1. ther is way to use one random value from my animation cocurved ? for example if want to instead i random numbers of enemies the way too the animation cocurved for this 2. Haw to make the animetion cocurved to return to 0 wean is go to the last stage and in eny other state? 3. Haw to stop and enable the animation cocurved?
I want to interpolate between 2 values using animation curves in code. How can I insert the maximun and minimun values through code while maintaining the curve shape made in the editor?
You can make the curve normalized, meaning make it go only from 0 to 1 Then through code multiply that by some value to get it between 0 and some value. And maybe add some offset to make it between offset -> value
I don't know if you or others read comments on videos this old but I was wandering something: is it possible to modify several animation curves in one window (i.e. like the curves in the animation tab)? How? If I find the answer before anyone reads this, I'll put it here as an edit or answer
I don't think so, at least I've never seen that being used outside of official Unity tools so I don't think that behaviour is exposed to regular users.
Hi, thanks for this, it was nice :) But I have a problem, because I created a 2D game, where I used animationClip.SetCurve() to modify my animatoins in runtime. It worked well in Editor, but when I built it to an Android phone, it didn't worked any more. Can someone help, why?
I don't know in what way to use the animetion cocurved yet but thenx for the tourial the truth I knew that system existed before sew this video becuse i have see this system on meny code but i did not know how to use that system before this video
I'm trying to use an animation curve to handle the headbob intensity for my game, but im having some problems setting both ends of the curve to my variables.
You mean it's jumping/jittery? Make sure the end point and the start point are exactly the same, also make sure there's no harsh curves between them, make them smooth
@@CodeMonkeyUnity Thanks! I ended up ditching that approach and I'm now using the Cinemachine noises, the Handheld Mild effect gave me what I was after :)
That's an interesting question, I've never done it but apparently you can access the data inside the "keys" discussions.unity.com/t/altering-animation-curves-via-script/160511/3
Bad design choice on unity part. "Animation curves can be used for much more than animations" Unless there is strict polymorphism, i do not see how this applies
What? In the video I show animation curves being used for the Enemy Spawn amount which is not an animation use case. I'm not sure I understand what you mean.
🌐 Have you found the videos Helpful and Valuable?
❤️ Get my Courses unitycodemonkey.com/courses or Support on Patreon www.patreon.com/unitycodemonkey
Just got your course, it was awesome! Definitely going to buy more if you make them.
I use AnimationCurves to simulate climate, average temperatures over the year, moon phases, wind strength, blending and even keyframing the generated weather to vary rain and wind. Then I use this info to calculate dewpoint and evaluate that combined with our temperature and humidity to determine fog.
AnimationCurves are awesome indeed.
i was about to say recently i have used curves to make a blinking star effect simply by changing its size .i was really proud tough but then i see you simulate conditions of an entire planet.
Yup, tons of awesome use cases!
Not sure if sarcasm or real comment 🤔
@@mahmutucak2293 :D :D
💬 Animation Curves are Awesome!
Did you know you could use them for just about anything?
I love how I can search 90% of unity 2d topics and Code Monkey is always there to give an informative and practical video that explains such topics :D
Heh yeah my goal is to cover just about every topic imaginable!
Already made 400 videos, it will be over 1000 in a few years!
@@CodeMonkeyUnity absolute legend in the game dev community 🏆✨
I wanted to use animation curves for a wave spawner as well, so started searching for examples, this is perfect.
I saw that animation curve in the particle system and wanted to use in normal scripts but never knew the name of it, and how usefull they are... thanks!
This is a great way to get a somewhat normal distribution! If you evaluate a random float on the interval from 0 to 1 then make the curve look like a zoomed in cubic function with an origin at (.5, avg). Depending on what you are going for the extremities can be around four standard deviations from the mean.
This can be used to determine the average health of a enemy, but give it some variety upon instantiation. A better example would probably be tree height in a well developed forest.
Thanks for the tutorial! I would have never thought of using animation curves for other purposes.
I didn't expect animation curve to be this much useful
I'm always lazy to watch videos to learn something new in unity. But you always prove me it worth doing it ❤️
To think I used to manually write linear equations if I wanted to scale a value over time, this is really helpful. Thanks for the video
I already know them, but I use them quite little. Thank you for this useful video which opens up some interesting possibilities.
Wow, this video blew my mind. I never would have thought to use animation curves this way and it seems super useful! I'm excited to try this out with a future project of mine. Thanks, Code Monkey!!
I'm glad the video helped! Best of luck with your project!
Very nice!
Using animation curves I prefer to clamp the curve within range of [0,1] on both axes, and send/apply its evaluation to normalized values. Advantage would be simpler configuration adjustments just from the class or scriptableObject, afterall it's just the curve shape we're interested in, not the values it posses.
I find it great that it can support both!
I used the same values as in the logic to keep the video simple but yup if I was making this in a proper game I would probably end up normalizing the graph.
Thanks for the awesome vid! Definitely going to start using them more! Although for your last example where you evaluate the curve at each index I would probably prefer to just make a serializable struct or scriptable object called "WaveInfo" that has an int for amount of enemies and an int for enemy health. Then you could just have a WaveInfo array on the spawner and set the stats for each wave in the inspector. I think that would feel more intuitive than matching two different curves for each wave
You literally saved my game jam game, man you're THE BEST! Waiting for your Xcom game style course to grab it! Learnead a lot from your builder defender course! Keep going ^^
That's great! Best of luck with your Game jam entry!
Last example is really awesome. What a great way to make fast & interesting levels! 👍🤓
Thank you this is the first time I knew about animation curves I wonder why no one is talking about them they're so useful
Awesome tutorial! That's what I was looking for! I spent so much time writing crappy progression systems for my game and now you saved me from that!
I'm glad you liked it, best of luck with your game!
Awesome! This is just what I needed. Thank you!
AM SO FUCKING GLAD I CLICKED ON THIS I THOUGHT I WAS GONNA HAVE TO INTERGRATE MY ACCELERATION FUNCTION AND THEN HAVE TO REINTEGRATE EVERYTIME I WANTED TO CHANGE THE FEEL OF THE ACCELERATION CURVE. btw the shooting in ur game looks so fucking fun
Yes, I have my own library to make pathfinding with it and plan to draw roads, attribute scaling... etc.
Awesome, didn't know about animation curves, this opens lot of possibilities. Thanks for sharing this information friend.
Thanks for this. It took me some time to adapt it to my own project, since I'm a noob. :)
Oh, ive been using gradients in the way you use the curves, a lot more easy to understand with curves tbh, but i didnt know about them so... i adapted with the things i knew
Color gradients? How do you use them in the same way as Animation Curves?
Cool! Especially when the video builds on previous lessons. CM - is the best !
Helpful content 👍
Great video, mate. Really helpful - just what I was looking for :D
Thank's for the tutorial, it's awesome...
Codemonkey you are the Bob Ross of unity programming.
I love Bob Ross so that's quite the compliment, thanks!
really awsome thank you man....you have just gave me what i need ...thank you a ton
Awesome!! Really great tool.
That is superb!
I use animation curves to modify terrain generation and image filtering. I didn't even consider them for the longest time. Wish they were just called curves.
I feel like you teach way more than my teachers
I have few questions about the animetion cocurved
1. ther is way to use one random value from my animation cocurved ? for example if want to instead i random numbers of enemies the way too the animation cocurved for this
2. Haw to make the animetion cocurved to return to 0 wean is go to the last stage and in eny other state?
3. Haw to stop and enable the animation cocurved?
Can i use animation curves to simulate root motion? ( by copying the animations position and rotation curve to script)
Awesome !!
I want to interpolate between 2 values using animation curves in code.
How can I insert the maximun and minimun values through code while maintaining the curve shape made in the editor?
You can make the curve normalized, meaning make it go only from 0 to 1
Then through code multiply that by some value to get it between 0 and some value. And maybe add some offset to make it between offset -> value
Thanks
I don't know if you or others read comments on videos this old but I was wandering something: is it possible to modify several animation curves in one window (i.e. like the curves in the animation tab)? How?
If I find the answer before anyone reads this, I'll put it here as an edit or answer
I don't think so, at least I've never seen that being used outside of official Unity tools so I don't think that behaviour is exposed to regular users.
can you make a tutorial of controlling vehicles inside unity
I will try to make camera movement effect with animation curves when the player walk or run I will make the camera move up and down
Hi, thanks for this, it was nice :)
But I have a problem, because I created a 2D game, where I used animationClip.SetCurve() to modify my animatoins in runtime. It worked well in Editor, but when I built it to an Android phone, it didn't worked any more. Can someone help, why?
I don't know in what way to use the animetion cocurved yet but thenx for the tourial the truth I knew that system existed before sew this video becuse i have see this system on meny code but i did not know how to use that system before this video
Please make a tutorial on cool boss fights...like if you killed the boss it will sub divided or something or anything like that !
I covered a Boss Fight here th-cam.com/video/qZC1VYWnHZ8/w-d-xo.html
@@CodeMonkeyUnity thanks a lot!
Yep, I use animation curves for my flight "simulator".
I'm trying to use an animation curve to handle the headbob intensity for my game, but im having some problems setting both ends of the curve to my variables.
You mean it's jumping/jittery? Make sure the end point and the start point are exactly the same, also make sure there's no harsh curves between them, make them smooth
@@CodeMonkeyUnity Thanks! I ended up ditching that approach and I'm now using the Cinemachine noises, the Handheld Mild effect gave me what I was after :)
You know how i can get the curve data from a animation clip?
Hi sir, please also make a video tutorial of fluid simulation using a code.Thank you🙏❤
I did make that here th-cam.com/video/_8v4DRhHu2g/w-d-xo.html
I want rto adjust the keys value at run time but it just doesnt work, any tips?
That's an interesting question, I've never done it but apparently you can access the data inside the "keys" discussions.unity.com/t/altering-animation-curves-via-script/160511/3
Hey, have you tested how this animation curves work on jumping?
Sure, that's yet another valid use case! Use it to define how fast the character moves up and how fast it comes down.
13:32 you can press A
Is there a way of using Animation Curves with Post Processing Effects?
Curves are just numbers so yes you can sample a point in the curve and apply it to any post processing parameter
nice video
Hey, I can't seem to find the link that was supposedly send to me when I created my account on your website unity code monkey.com
WHY DID UNITY NAME THESE *ANIMATION* CURVES INSTEAD OF JUST CURVES
why i only have two points in curves?
Double click to add more
Me and the boys compering pp: 1:32
Hmm
first comment yayyy
mine is second
Bad design choice on unity part.
"Animation curves can be used for much more than animations"
Unless there is strict polymorphism, i do not see how this applies
What? In the video I show animation curves being used for the Enemy Spawn amount which is not an animation use case. I'm not sure I understand what you mean.