Stop Using Lerp Wrong! Here's a Better Way

Ғылым және технология

A common mistake beginners make when using Unity's Lerp function for moving objects is keeping t, the blend factor, constant. While this does still work, it causes some problems that might affect you.
In this video I'll show you a much better way to implement lerp where you can also add your own custom smoothing using an AnimationCurve.
I felt like doing something new for the intro, hope you liked it lol
This is the dora theme remix I played: • Dora The Explorer (OFF...

Пікірлер: 20

  • @user-tx1bg7hy8v
    @user-tx1bg7hy8vАй бұрын

    Ah yes, always the correct way to learn. With Dora the explorer

  • @theunknown1050

    @theunknown1050

    Ай бұрын

    the theme is 🔥🔥🔥

  • @FishSticker
    @FishStickerАй бұрын

    To anyone saying he’s strictly using it wrong, the original use case still has great utility for smooth exponential chasing, Freya holmer (queen of linear interpolation) has a whole talk about this and how to frame rate sync

  • @theunknown1050

    @theunknown1050

    29 күн бұрын

    Freya knows everything about programming related math Didn’t know she had a talk on lerping but I would love to watch it!

  • @dmansor2
    @dmansor2Ай бұрын

    i thought it was common sense to use lerp this way. what's the other way?

  • @theunknown1050

    @theunknown1050

    Ай бұрын

    The other way is to keep t constant and set the starting position to the current position of the object being moved. It causes the two problems mentioned in the video (non linear movement and the object not actually reaching the target position) Some people are introduced to this method for smooth movement through tutorials and never learn otherwise. While it’s not exactly wrong, it’s much better to use the method I show in the video imo

  • @Fine_Mouche
    @Fine_Mouche23 күн бұрын

    I want to make a game since 2015, but i'm so noob i currently only do it with numerically (a set represent edge and another set represent the path) (and even this i had struggle to do it). It would be game where we move along the sides of polygons leaving a trace of a certain color, we can go back this will trace [[above/beside] / this will make another floor ] and when we have gone around the polygon respecting the rules*, this changes the color of the trace and saves it if it does not already exist. (*ex: no more than 2 round trips on the same segment/side)

  • @thepixelers9921
    @thepixelers9921Ай бұрын

    Ah i see, i shall now use lerp using this method! 😮😅

  • @theunknown1050

    @theunknown1050

    Ай бұрын

    To err is human; to use lerp correctly is divine

  • @timmygilbert4102
    @timmygilbert410228 күн бұрын

    Someone had seen that Freya Holmer video too 😊

  • @theunknown1050

    @theunknown1050

    28 күн бұрын

    I actually haven’t haha but another commenter mentioned it too and I’ll probably watch it if I get the chance!

  • @ThunderFound
    @ThunderFoundАй бұрын

    Great video! Very informative

  • @theunknown1050

    @theunknown1050

    Ай бұрын

    I’m glad it could help!

  • @spacehunter2018
    @spacehunter2018Ай бұрын

    very informative and educational, someone like me who has never touched any form of code before can easily understand this. very nice! Very great! very awesome!!!

  • @theunknown1050

    @theunknown1050

    Ай бұрын

    thats what im saying fr everyone listen to this guy

  • @felfar197
    @felfar197Ай бұрын

    beautiful video!

  • @theunknown1050

    @theunknown1050

    Ай бұрын

    thank you! I spend a lot of time on visuals

  • @atomiz2002
    @atomiz2002Ай бұрын

    this video seems more of an explaination to your misunderstanding of how lerp works because you closed the tutorial you were following as soon as the line of code at the beginning was written...you cant title a video stop using lerp wrong when youre the one using it wrong rather than the massively acceptable way

  • @theunknown1050

    @theunknown1050

    Ай бұрын

    Sorry if I’m misunderstanding your comment but I had no tutorial open at the start lol the video on my laptop was something I made so I’m not completely sure what you’re talking about

Келесі