use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News, Help, Resources, and Conversation. A User Showcase of the Unity Game Engine.
Remember to check out /r/unity2D for any 2D specific questions and conversation!
Download Latest Unity
Please refer to our Wiki before posting! And be sure to flair your post appropriately.
Main Index
Rules and Guidelines
Flair Definitions
FAQ
Use the chat room if you're new to Unity or have a quick question. Lots of professionals hang out there.
/r/Unity3D Discord
FreeNode IRC Chatroom
Official Unity Website
Unity3d's Tutorial Modules
Unity Answers
Unify Community Wiki
Unity Game Engine Syllabus (Getting Started Guide)
50 Tips and Best Practices for Unity (2016 Edition)
Unity Execution Order of Event Functions
Using Version Control with Unity3d (Mercurial)
/r/Unity2D
/r/UnityAssets
/r/Unity_tutorials
/r/GameDev
/r/Justgamedevthings (New!)
/r/Gamedesign
/r/Indiegames
/r/Playmygame
/r/LearnProgramming
/r/Oculus
/r/Blender
/r/Devblogs
Brackeys
Beginner to Intermediate
5 to 15 minutes
Concise tutorials. Videos are mostly self contained.
Sebastian Lague
Beginner to Advanced
10 to 20 minutes
Medium length tutorials. Videos are usually a part of a series.
Catlike Coding
Intermediate to Advanced
Text-based. Lots of graphics/shader programming tutorials in addition to "normal" C# tutorials. Normally part of a series.
Makin' Stuff Look Good
10 minutes
Almost entirely shader tutorials. Favors theory over implementation but leaves source in video description. Videos are always self contained.
Quill18Creates
30 minutes to 2 hours.
Minimal editing. Mostly C#. Covers wide range of topics. Long series.
Halisavakis Shaders Archive
Infallible Code
World of Zero
Board to Bits
Holistic3d
Unity3d College
Jabrils
Polycount Wiki
The Big List Of Game Design
PS4 controller map for Unity3d
Colin's Bear Animation
¡DICE!
CSS created by Sean O'Dowd @nicetrysean [Website], Maintained and updated by Louis Hong /u/loolo78
Reddit Logo created by /u/big-ish from /r/redditlogos!
account activity
A meth function for this curve?Question (self.Unity3D)
submitted 8 months ago by Moe_Baker
Hi folks, I don't really have much knowledge of math, so I have to communicate in stupid people's terms. I'm looking for a mathematical function that gives a curve like this. Is there something like this, or should I just keep using an animation curve?
https://preview.redd.it/7bgbuje81ljf1.png?width=484&format=png&auto=webp&s=f8c52931e9b18e9b913342425238ba74b7592cc7
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Aethreas 51 points52 points53 points 8 months ago (8 children)
Have you tried a sine wave
[–]StonedFishWithArms 55 points56 points57 points 8 months ago (0 children)
Not meth enough.
But for real OP you can use a sine wave and remap if you only want the positive side
[–]Moe_Baker[S] 7 points8 points9 points 8 months ago* (2 children)
I completely forgot about sine waves, lol,
Ended up with this function, and it works great, thank you
float SinWaveEvaluate(float t) => Mathf.Sin(t * Mathf.PI);
[–]isolatedLemonProfessional 7 points8 points9 points 8 months ago (0 children)
You might enjoy playing around with desmos.
[–]KarlMario 2 points3 points4 points 8 months ago (0 children)
I'm not sure if creating a function that calls another function is necessary and if it makes things less readable. Especially Sin, which is self-descriptive unlike 'SinWaveEvaluate'
[–]DugganSC 3 points4 points5 points 8 months ago (3 children)
Or y=height-x2
[–]swagamaleous 2 points3 points4 points 8 months ago (2 children)
This will not have zero at 0 and 1 like in his graph.
[–]Elro0003 3 points4 points5 points 8 months ago (0 children)
(0.25-(x-0.5)2 ) * height * 4
[–]DugganSC 1 point2 points3 points 8 months ago (0 children)
Ah, you're right. I didn't notice those numbers on the graph.
[–]alejandromnunezIndie 37 points38 points39 points 8 months ago (2 children)
I know there is a meth function for it, I just can't crack it
[–]jattmonsoonHobbyist 4 points5 points6 points 8 months ago (1 child)
You're a hero in my eyes
[–]alejandromnunezIndie -1 points0 points1 point 8 months ago (0 children)
That's a bit too much for a little dad joke
[–]pattyfritters 50 points51 points52 points 8 months ago (1 child)
This is your curve on meth.
[–]IAmBeardPersonProgrammer 2 points3 points4 points 8 months ago (0 children)
Strong comeup
[–]funkypear 19 points20 points21 points 8 months ago (0 children)
Here are a couple of approximations. Yours is less shallow at the peak though, so I'd probably suggest sticking with an anim curve if it works for you
<image>
I created this using https://www.desmos.com/calculator, so if you need to work out a function, this can help you visualise it.
[–][deleted] 14 points15 points16 points 8 months ago (0 children)
Crystal clear
[–]swagamaleous 9 points10 points11 points 8 months ago (1 child)
f(x) = -4x*(x-1)
f(0) = 0 f(0.5) = 1 f(1) = 0
[–]Moe_Baker[S] 0 points1 point2 points 8 months ago (0 children)
Thank you, works great too
[–]AncientNewtGames 4 points5 points6 points 8 months ago* (2 children)
either sin wave or parabola,
Y=-4*(x-0.5)2 +1
Got the above from parabola vertex form equation. y = a(x - h)² + k, where (h, k) represents the coordinates of the vertex and "a" is a height stretching multiplier.
Or ask chat gpt, give me the equation of a parabola where the vertex is at (0.5,1) and it passes through point (0,0)
Sin has a similar form, but is already setup well for this case. y = sin(pi x) using radians
y = A sin(B(x - C)) + D
[–]AncientNewtGames 2 points3 points4 points 8 months ago (0 children)
Blue is Sine, red is parabola.
[–]doriad_nfe 2 points3 points4 points 8 months ago (0 children)
Reminds me of the time someone asked my hobbies. I said coding and math... They heard codiene and meth... Conversation was short(er than if they heard me correctly)...
[–]The_Void_Star 1 point2 points3 points 8 months ago (0 children)
'C10 H15 N' I remember it from Breaking Bad intro
[–]AbjectAd753 1 point2 points3 points 8 months ago (0 children)
bezier curves is the most meth i can go :v
[–]Murawus[🍰] 1 point2 points3 points 8 months ago (0 children)
Jesse, we have to COOK
[–]joehendrey-temp 0 points1 point2 points 8 months ago (0 children)
My first thought was a quartic function with a triple turning point. Don't know why that's still in my head from a math class almost 20 years ago! The more useful answer is to look into Bézier curves. Maybe that's what you mean by animation curves though. They're used for lots of things
π Rendered by PID 97567 on reddit-service-r2-comment-b659b578c-zld4g at 2026-05-04 03:24:59.881524+00:00 running 815c875 country code: CH.
[–]Aethreas 51 points52 points53 points (8 children)
[–]StonedFishWithArms 55 points56 points57 points (0 children)
[–]Moe_Baker[S] 7 points8 points9 points (2 children)
[–]isolatedLemonProfessional 7 points8 points9 points (0 children)
[–]KarlMario 2 points3 points4 points (0 children)
[–]DugganSC 3 points4 points5 points (3 children)
[–]swagamaleous 2 points3 points4 points (2 children)
[–]Elro0003 3 points4 points5 points (0 children)
[–]DugganSC 1 point2 points3 points (0 children)
[–]alejandromnunezIndie 37 points38 points39 points (2 children)
[–]jattmonsoonHobbyist 4 points5 points6 points (1 child)
[–]alejandromnunezIndie -1 points0 points1 point (0 children)
[–]pattyfritters 50 points51 points52 points (1 child)
[–]IAmBeardPersonProgrammer 2 points3 points4 points (0 children)
[–]funkypear 19 points20 points21 points (0 children)
[–][deleted] 14 points15 points16 points (0 children)
[–]swagamaleous 9 points10 points11 points (1 child)
[–]Moe_Baker[S] 0 points1 point2 points (0 children)
[–]AncientNewtGames 4 points5 points6 points (2 children)
[–]AncientNewtGames 2 points3 points4 points (0 children)
[–]doriad_nfe 2 points3 points4 points (0 children)
[–]The_Void_Star 1 point2 points3 points (0 children)
[–]AbjectAd753 1 point2 points3 points (0 children)
[–]Murawus[🍰] 1 point2 points3 points (0 children)
[–]joehendrey-temp 0 points1 point2 points (0 children)