[Unity] 2D Curve Editor (E01: introduction and concepts)

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024
  • In this series we'll be creating a 2d bézier curve editor. This first episode introduces some of the basic concepts.
    Support the creation of more gamedev tutorials:
    / sebastianlague

ความคิดเห็น • 144

  • @dokstader
    @dokstader 6 ปีที่แล้ว +89

    Holy shit im excited for this series

    • @Varaughe
      @Varaughe 4 ปีที่แล้ว +2

      If you wanna additional excitation, check out "runtime curve editor" on unity asset store, with that you are able to edit curves at runtime.

  • @True_Beef
    @True_Beef 6 ปีที่แล้ว +7

    Always extremely impressed when it comes to your videos. Number one person to go to when I need help with maths application in my games.

  • @KrisDeSchutter
    @KrisDeSchutter 6 ปีที่แล้ว

    An old university professor of mine needed two classes to explain beziers. You did it in less than four minutes and, I would argue, much more clearly. Well done !

  • @bestcreations4703
    @bestcreations4703 2 ปีที่แล้ว

    I’ve always sort of glossed over the actual implementation of the lerp equation but I just realised it’s incredibly intuitive why it’s set up the way it is. You start with the value a, you want to have some point a certain percentage between a and the other point b. You find the “vector” that points from a to b by subtracting a from b. You multiply it by some percentage t and add that back onto the original point a. In other words a + (b-a) * t. It blows my mind how much I’ve used that sort of logic before but never made the connection until now.

  • @skeptikwatcher9910
    @skeptikwatcher9910 6 ปีที่แล้ว

    That moment when I just started working on a mobile game using these concepts and then a week later you produce this gem

  • @MatthewChowns
    @MatthewChowns 6 ปีที่แล้ว

    Can't wait for this series. So many applications that this could be used for!

  • @Jhonbxl
    @Jhonbxl 11 หลายเดือนก่อน

    Thanks, finally understood what that T was for and why control points are needed!

  • @jacktruong7151
    @jacktruong7151 4 ปีที่แล้ว

    Very simple explanation with awesome visualization

  • @happyfarang
    @happyfarang 6 ปีที่แล้ว

    very cool seb. Best visualization of Bsplines ever :) Looking forward to the rest of this series. A good implementation of this is missing from Unity so this will be super useful! Thanks!!!

  • @themerpheus
    @themerpheus 6 ปีที่แล้ว

    thats a nice subject to look at Sebastian. I am glad to saw it.

  • @hrmny_
    @hrmny_ 6 ปีที่แล้ว +1

    I was looking for something like this for so long now

  • @kalucky0
    @kalucky0 6 ปีที่แล้ว +2

    OMG! OMG!!! So useful! Can't wait for more!

  • @nandorbacso4625
    @nandorbacso4625 4 ปีที่แล้ว

    Wowowow that was the problem I've been thinking about for 2 years

  • @plaaosert
    @plaaosert 6 ปีที่แล้ว +20

    that was incredibly interesting and informative, really well put across. very excited for this series

    • @ForfunckleStudios
      @ForfunckleStudios 6 ปีที่แล้ว +1

      Yeah, amazing concept! How to curve sooch?

  • @JorgeCR
    @JorgeCR 6 ปีที่แล้ว

    sir why you have 2 dislikes? this is one of the best explanations ever, thanks!

  • @mikesirman
    @mikesirman 5 ปีที่แล้ว

    Your channel is amazing

  • @mikeokismall3831
    @mikeokismall3831 4 ปีที่แล้ว

    Why is it that I can watch 5 videos on bezier curves, but your explanation is the easiest to comprehend?

  • @DerXavia
    @DerXavia 6 ปีที่แล้ว

    simple and effective, nice!

  • @mzijewel
    @mzijewel 6 ปีที่แล้ว +2

    It will a great tutorial. I'm eagerly waiting to watch it. Thanks a lot

  • @navidev2281
    @navidev2281 6 ปีที่แล้ว

    Cool! i love Sebastian sensei!

  • @Cristian-bs4fw
    @Cristian-bs4fw 4 ปีที่แล้ว

    You are a god damn genius

  • @mikeystojsic
    @mikeystojsic 6 ปีที่แล้ว

    I hit that bell icon like 20 seconds in :P

  • @artemistoh9321
    @artemistoh9321 6 ปีที่แล้ว

    Alright, I'm gonna try to make a game using this!

  • @HadiExtreme
    @HadiExtreme 6 ปีที่แล้ว

    Thank you for this, Sebastian! I have a request, if possible, or if not, at least some direction in the right way:
    You said you want to move objects along the curve. Would it be possible to add functionality to make the object move independently after reaching the end, attach to a curve later on, or jump from curve to curve? An example use case would be moving along the path, then giving the player freedom when jumping, or the ability to go off and move using another controller, then come back and continue along the path at a certain point?

  • @koktszfung
    @koktszfung 6 ปีที่แล้ว

    Remind me of the pen tool in adobe illustrator!

  • @bemistertessema573
    @bemistertessema573 ปีที่แล้ว

    Tried using the QuadraticCurve function but for some reason, the object I am trying to move is only moving from point a to point b. Can anyone explain why?

  • @gasmisalaheddine6933
    @gasmisalaheddine6933 5 ปีที่แล้ว

    Hi Sebastian !! I am really loving all of your work, but i have a question about this serie, i want to do the same thing but during runtime and not in the editor, how can i do that ?

  • @jackliang2994
    @jackliang2994 6 ปีที่แล้ว

    amazing!

  • @Yamyatos
    @Yamyatos 4 ปีที่แล้ว

    Not a huge deal, but since you always link the entire repository, containing all episodes anyways, wouldnt it make sense to also link it under the first episode? Super minor thing i know^^

  • @hadisantamaria3391
    @hadisantamaria3391 3 ปีที่แล้ว +1

    why are the subtitles in japanese

  • @pythooonuser2233
    @pythooonuser2233 5 ปีที่แล้ว

    Sebastian, how are you making these fabulous interactive animations? I remember you saying something about a JS library on Twitter once. Unfortunately I can't remember anymore.

    • @SebastianLague
      @SebastianLague  5 ปีที่แล้ว +1

      Hi, if I remember correctly, all the animations in this episode were made in unity. I do sometimes use p5js though.

  • @sumovsprov7392
    @sumovsprov7392 6 ปีที่แล้ว +1

    Tell me please what color theme do you use?

    • @SebastianLague
      @SebastianLague  6 ปีที่แล้ว +1

      I use this custom theme: pastebin.com/S1tM4GYz

    • @sumovsprov7392
      @sumovsprov7392 6 ปีที่แล้ว

      but what should I do with this file

    • @SebastianLague
      @SebastianLague  6 ปีที่แล้ว

      If you have vs community, just add it to the themes folder.

    • @sumovsprov7392
      @sumovsprov7392 6 ปีที่แล้ว

      But this is txt file. I need vssettings , or tmtheme files

    • @SebastianLague
      @SebastianLague  6 ปีที่แล้ว

      It's tmtheme format, just change the extension..

  • @sandichhuu
    @sandichhuu 6 ปีที่แล้ว

    Good techniq

  • @gregoryhause00
    @gregoryhause00 6 ปีที่แล้ว

  • @VerticalVertex
    @VerticalVertex 6 ปีที่แล้ว

    black magic.

  • @showdowngamer4463
    @showdowngamer4463 6 ปีที่แล้ว

    4. like your vids

  • @brendangetz3670
    @brendangetz3670 5 ปีที่แล้ว +7

    You've taken a complicated concept, broken it down, and visualized it beautifully. Thank you.

  • @ruansmith5919
    @ruansmith5919 3 ปีที่แล้ว +1

    Thank you for the video. Is there a way I can make the object following the path jump to another path (like a slot car for example) TIA

  • @krushnaa5
    @krushnaa5 6 ปีที่แล้ว +5

    This is awesome! I've looked at these concepts before - but I've never felt like it's this simple until you explained it. You really have a knack for breaking down seemingly complex concepts. I appreciate how you keep it short and simple as well.

  • @Cinarbayramic
    @Cinarbayramic 3 หลายเดือนก่อน +1

    i was desperate looking for ways to make an easy way to make roads in my game thank you for the tutorial.

  • @justinwr092
    @justinwr092 6 ปีที่แล้ว +1

    This is great fucking dope. Great. Fucking. Dope.

  • @dh7222
    @dh7222 6 ปีที่แล้ว +3

    it just happens that I'm learning interpolation and curve generation lately and looking for some good tutorials. And here it is! Thank you very much for making this!

  • @notlunaticdancer4393
    @notlunaticdancer4393 6 ปีที่แล้ว +10

    Splendid job, I thought that bezier curves were more complex than this, but turns out they are banal.

    • @ideallyyours
      @ideallyyours 6 ปีที่แล้ว +2

      The complexity is mainly in the lerp functions. Once you understand how the interpolation works it all starts to make sense :)

    • @mspeir
      @mspeir 5 ปีที่แล้ว +1

      They are easier than you know. You can do very simple subdivision of the control points and get a curve of arbitrary resolution with minimal effort and code. If you stick to an integer grid, this can be accomplished with nothing more than adds and bit shifts.

  • @GameDev1
    @GameDev1 6 ปีที่แล้ว +1

    The obvious thing to do would be a 3d version and create a roller coaster :-)

  • @HadiExtreme
    @HadiExtreme 6 ปีที่แล้ว +2

    I've been interested in these for a while now, thanks! Looking forward to this!

  • @lfernandods
    @lfernandods 6 ปีที่แล้ว +1

    while(!nextVideo){
    waitingAnxious = true;
    }

  • @unnamer345
    @unnamer345 4 ปีที่แล้ว +1

    Thanks to you and your videos, I started working as a game programmer, and in one project I needed to do something similar to what is in this video. When I got down to work, I immediately remembered this video. Now I am watching it and I want to say Thank you very much for your efforts!

  • @criwing
    @criwing 5 ปีที่แล้ว +1

    One of the best tutorials I have ever seen. Really love your visualizations! Thanks a lot!

  • @nacramri6919
    @nacramri6919 6 ปีที่แล้ว +1

    your truly amazing Sebastian, thanks for the amazing tuts..!

  • @JudahMantell
    @JudahMantell 4 ปีที่แล้ว

    Is there any way to adapt this to work at runtime? Like for a level editor type thing?

  • @xcage90
    @xcage90 6 ปีที่แล้ว +1

    It is absolutely amazing, looking forward to use this in my road project

  • @VladSviatetskyi
    @VladSviatetskyi 5 ปีที่แล้ว +1

    love it, you made it easy to understand!

  • @ysl8589
    @ysl8589 3 ปีที่แล้ว

    Hello, I found this video while looking to use the navmeshagent function. I'm trying to specify the path to navmesh dynamically. This video is in 2D, is it possible to install it on a plane? Is it only available in the editor? I want to be able to create it during runtime, but I want to know if it's impossible.

  • @hickna
    @hickna ปีที่แล้ว

    Just amazing explanation

  • @TheRojo387
    @TheRojo387 6 หลายเดือนก่อน

    Ever hear of NURBS?

  • @cheynebransby6510
    @cheynebransby6510 10 หลายเดือนก่อน

    Did the idea of how to move an object along the curve, ever get covered. If it did I missed it and can someone point me in the right direction?

  • @Geckotr
    @Geckotr 3 ปีที่แล้ว

    this is some high level coding shit. It's way beyond me at this rate!

  • @robosergTV
    @robosergTV 5 ปีที่แล้ว

    is there an easy way to create walls on the sides of the road? Where the yellow lines are.

  • @muzafferkadir
    @muzafferkadir 3 ปีที่แล้ว

    you are the best sebastian

  • @BrownSloth0
    @BrownSloth0 3 ปีที่แล้ว

    This is another word beizer curve

  • @krishnakantsharma1053
    @krishnakantsharma1053 2 ปีที่แล้ว

    How can I stop the object at a certain point?

  • @kerim404tt5
    @kerim404tt5 5 ปีที่แล้ว

    Can we do this with ui slider?

  • @xrcryptodev
    @xrcryptodev 4 ปีที่แล้ว

    Sebastian Lague = legend

  • @armandoferreira1346
    @armandoferreira1346 5 ปีที่แล้ว +1

    I think im in love with another man.

  • @kevmscotland
    @kevmscotland 6 ปีที่แล้ว +5

    So I'm curious how you would get a car to follow such a layout including slowing behaviour for corners and accelerating behaviour for straights. I'm picturing an F1 car here as I talk, so it would lead into and out of corners.

    • @ideallyyours
      @ideallyyours 6 ปีที่แล้ว +1

      You'd most likely have to code some sort of "sampling" function, where you test the curve's direction some distance ahead along the curve, and compare it to your current direction. If that variance falls outside a certain threshold, you are likely turning a corner, and should "turn into" the curve by interpolating within that variance, with a time offset.

    • @janrensen9097
      @janrensen9097 6 ปีที่แล้ว +2

      This could maybe be a follow up for this series. I'd love to see such a video!

    • @detectiveking1463
      @detectiveking1463 6 ปีที่แล้ว +2

      It actually quite eazy.Direction is first derivative,acceleration is second derivative.Because the curve function is single variable it's so eazy to calculate its derivative so you just check if the direction difference of the first derivative and second derivative

  • @RatoCavernaBR
    @RatoCavernaBR 6 ปีที่แล้ว

    This can be used together with your infinite terrain generator to define biomes.

  • @McWolke92
    @McWolke92 3 ปีที่แล้ว

    not only is the visualisatin great, the maths also makes sense! thanks for this explanation!

  • @P4INKiller
    @P4INKiller 6 ปีที่แล้ว

    Thank you, it all makes sense now.

  • @JelgerMuylaert
    @JelgerMuylaert 5 ปีที่แล้ว

    At 2:30 this formula results in the following code, which should run faster.
    You can just replace the two methods in the Bezier class by this one Method and all works the same.
    public static Vector2 EvaluateCubic( Vector2 p0, Vector2 p1, Vector2 p2, Vector2 p3, float t )
    {
    t = Mathf.Clamp01(t);
    float oneMinusT = 1f - t;
    return
    oneMinusT * oneMinusT * oneMinusT * p0 +
    3f * oneMinusT * oneMinusT * t * p1 +
    3f * oneMinusT * t * t * p2 +
    t * t * t * p3;
    }

  • @niuage
    @niuage 4 ปีที่แล้ว

    This kind of demystified bezier curves for me, nice.

  • @MatthiasTTV
    @MatthiasTTV 6 ปีที่แล้ว

    Can't wait for the rest of this. Looks like a project I've been following for quite some time: forum.unity.com/threads/sentieri-beta-0-5-terrain-procedural-path-creator-for-roads-rivers-and-more.443121/

  • @aapdev8931
    @aapdev8931 6 ปีที่แล้ว

    I'm waiting for the 2 video anxiety will kill me

  • @KaletheQuick
    @KaletheQuick 6 ปีที่แล้ว

    Awesome. I did my own implementation of this from a GDC talk, and can't wait to watch yours :3

  • @lyes6033
    @lyes6033 6 ปีที่แล้ว

    this one looks interesting as always of course :D

  • @wokarol
    @wokarol 6 ปีที่แล้ว

    Can you make series about Animator and Animator Scripts? How Layers and this kind of stuff work. For me it's really a trouble to make good animation transitions, and to controll animations from the script.

  • @dino4941
    @dino4941 6 ปีที่แล้ว

    I had to deal with the bezier curves in graphics programming.... this 3 minute explanation would have saved me quite some hours of work and a lot of headaches

  • @Amitkuliyal
    @Amitkuliyal 6 ปีที่แล้ว

    you are the best (Y) keep making these great videos

  • @ziggyzoggin
    @ziggyzoggin 4 ปีที่แล้ว

    tysm! i haven't found a tutorial this good, most are just like "alright so there is this pre made function, use that. bye have a great day!" and its not helpful for people on scratch like me. you really helped me smooth out some angles in my fluid simulation! scratch.mit.edu/projects/413587912/

  • @guchfun
    @guchfun 4 ปีที่แล้ว

    Unity + Math = Outstanding! Thank you for creating this tutorial Sebastian. Very informative.

  • @yourcommander3412
    @yourcommander3412 3 ปีที่แล้ว

    I always though like the unity plane path waypoint beziers would be a great start for roads. But then I thought about the actual roat mesh generation and got tired - thankfully I can learn something from you !

  • @fardinhaque70
    @fardinhaque70 6 ปีที่แล้ว

    Just what i was trying to learn past few weeks!!
    Waiting for next ep, 😊

  • @jacobwills1229
    @jacobwills1229 4 ปีที่แล้ว

    This video was great. Excellent explanation.

  • @Stnaire
    @Stnaire 5 ปีที่แล้ว

    The best explanation of bezier curves EVER. Thank you for your time and effort in the making of this video, you deserve many more views. I'll follow your series with great pleasure. Thanks again.

  • @EdwinSyarief
    @EdwinSyarief 6 ปีที่แล้ว

    Hi Sebastian, can you make tutorial using this technic about making 2d wire with verlet integration?

  • @darkbibni
    @darkbibni 6 ปีที่แล้ว

    Oh nice !
    I already worked with Bezier curve in the past but never with unity
    You inspire me a lot to create some tools for a rts editor ^^

  • @ronnieshmuel5193
    @ronnieshmuel5193 6 ปีที่แล้ว

    Perfectly explained, so simple. Thanks.

  • @nomadcrossfire
    @nomadcrossfire 6 ปีที่แล้ว

    just curious, when you make the animations for your videos do you make them in unity? or do you use something else like after effects?

  • @kuteninja
    @kuteninja 6 ปีที่แล้ว

    I was very interested up until you said "procedural generation", then I thought of dungeons and my mind got aroused

  • @himanshutak4926
    @himanshutak4926 6 ปีที่แล้ว

    This will be Awesome like others Thank you very much Sebastian Lague you are the best tutor i have ever seen in my life

  • @Aakwe
    @Aakwe 6 ปีที่แล้ว

    I'd like to know if calculation for a curve's length is possible.

  • @jermainej602
    @jermainej602 6 ปีที่แล้ว

    I'll be the world's happiest person if this series concludes as a replica of photoshop/illustrator pen tool for unity

  • @jugibur2117
    @jugibur2117 3 ปีที่แล้ว

    The visual representation of the functions have helped me a lot to understand it better, thanks for your effor!

  • @roiiam
    @roiiam 6 ปีที่แล้ว

    Hungry for more! I hope you will make more videos, they are such well thought.

  • @mrslake7096
    @mrslake7096 6 ปีที่แล้ว

    Still the best programmer I've seen, keep up the great work

  • @OtjPlateo
    @OtjPlateo 5 ปีที่แล้ว

    One of the most informative videos I have ever watched. And it's not even 4 minutes long.

  • @had1t1x85
    @had1t1x85 6 ปีที่แล้ว

    I have to make a presentation of my traineeship i did in maths. This video definitely reminded me of things i learnt!

  • @chrislee50
    @chrislee50 6 ปีที่แล้ว

    damn 545 likes 0 dislikes amazing community!

  • @ИгорьКовалев-т1т
    @ИгорьКовалев-т1т 4 ปีที่แล้ว

    Amazing explanation! Thank you!

  • @davidsnyder518
    @davidsnyder518 5 ปีที่แล้ว

    how did you lock the controlpoints into a line with the anchorpoints?

  • @Lucifer-ss4mz
    @Lucifer-ss4mz 6 ปีที่แล้ว

    Awesome!
    A question: ¿How do you learn all this stuff?