Physically accurate conveyors in Unity

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024

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

  • @nikefootbag
    @nikefootbag 3 ปีที่แล้ว +2471

    For anyone struggling to get this working, the key is to set the conveyor belt's rigidbody to IsKinematic (to be fair this is shown in the video, but it's not mentioned as an explicit step by the author and his fucking conveyor belt's name is also cube so...)
    For clarity tho:
    - Boxes that go on the conveyor need a rigidbody and a box collider, defaults settings work with no issue (so Rigidbody Mass: 1, Drag: 0, Ang Drag: 0.05, UseGravity: yes, IsKinematic: no)
    - Conveyor Belt object needs a rigidbody and a box collider.
    Rigidbody settings: Mass: 1, Drag: 0, Ang Drag:0.05, UseGravity: yes. IsKinematic: YES
    Box collider default settings work fine. Make sure the collider extends the length of your conveyor (e.g. if modelling it yourself).
    Also Note, if you have Physics materials on either object's colliders, make sure the friction values are greater than 0, and friction combine not set to minimum.

  • @moofymoo
    @moofymoo 3 ปีที่แล้ว +1530

    Physically correct Biter to chew on these belts next!

    • @rtificial8292
      @rtificial8292 3 ปีที่แล้ว +104

      The factory must grow

    • @RustyNova
      @RustyNova 3 ปีที่แล้ว +46

      I see you are a person of culture

    • @axyuwu5678
      @axyuwu5678 3 ปีที่แล้ว +11

      @@RustyNova and so are you

    • @coffeeman882
      @coffeeman882 3 ปีที่แล้ว +23

      IS THAT A FACTORIO REFERENCE?

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

      Physically correct flare to harass my conveyers

  • @Specoolar
    @Specoolar  4 ปีที่แล้ว +651

    Use -transform.forward instead of Vector3.back to make the movement in local space

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

      Hey could you share the texture or shader please? I love it

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

      nvm got them

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

      @@daliborin Where did you get it dude? Sharing is caring :))

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

      @@tayyipensarozkaya2329 merhaba türk kardeşim

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

      @@omerfarukbykl6097 Merhabalar :)

  • @DonBloomfield
    @DonBloomfield 4 ปีที่แล้ว +87

    I really admire your clear style here. Well done!

  • @NStripleseven
    @NStripleseven 3 ปีที่แล้ว +38

    Makes sense, actually. MovePosition actually drags the belt a bit, and setting position just teleports.

  • @DevanK-rg3td
    @DevanK-rg3td 3 ปีที่แล้ว +76

    why was this recommended to me by the algorithm

    • @diplo6277
      @diplo6277 3 ปีที่แล้ว +20

      It's not recommended to you, it's delivered to you by a conveyor belt algorithm.

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

      Because you like salami

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

      the algorithm assumed you were smart

  • @greenbin3028
    @greenbin3028 3 ปีที่แล้ว +5

    Remarkably simple but elegant implementation, I'll keep this in mind

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

    Honestly by this stage I don’t even know why I’m getting recommended videos from 11 years ago

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

    It is really helpful that you explained the steps at the start. Too frequently people upload a finished code and I have no idea why what they wrote works for the implementation.

  • @ethribin4188
    @ethribin4188 3 ปีที่แล้ว +4

    Funnily enough, Factorio started with realistic belt physics.
    Thats where the two belt sides come from!

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

    Came for the conveyors. Stayed for the funky music

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

    What a beautiful and elegant and efficient solution.

  • @LaidbackLost
    @LaidbackLost 3 ปีที่แล้ว +32

    “He probably thinking about other girls”
    My brain:

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

      Yes exactly

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

      plot twist: you said that to yourself cause you don't have a girlfriend

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

    Oh like the old Little Big Planet 3 Sonic Speed glitch. Glad to know logic breaks when making thing like this

  • @lemonenjoyer6410
    @lemonenjoyer6410 3 ปีที่แล้ว +8

    He needs morr subs, the editing is amazing :O

  • @Halo_Legend
    @Halo_Legend 3 ปีที่แล้ว +7

    Is it strange that just by looking at it I know exactly what it's made of and how that rubber feels?

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

      Kinda

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

      It's probably just the textures because i just can't imagine rendering that thing as individual objects

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

      Plot twist it’s made out of bits and bytes

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

      @@GrafRucola technically it is.

  • @fitrianhidayat
    @fitrianhidayat 3 ปีที่แล้ว +8

    I somehow thought the title was
    "Politically correct conveyors" and got confused

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

    Thought this was just going to give a link to a marketplace asset but instead it actually shows you how to do it!

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

    What is this doing in my feed? No matter, this was satisfying to watch.

  • @dominictonisson1946
    @dominictonisson1946 3 ปีที่แล้ว +7

    its actually sad that these physics are even better than in cyberpunk 2077

  • @omgtntlol
    @omgtntlol 3 ปีที่แล้ว +2

    The best 2 minute tutorial. Ever.

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

    transform.Translate(Vector2.right * horizontalAxis * speed * time.deltaTime) would be great too for movement. Or the new input System that I don't like.
    (It would be working with a Vector2.Zero variable that you can assign with a variable like vectomov.x or make the x a public string to assign it how you want)
    I like this. This is great what you were doing here.

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

    Super cool, and intriguing. Appreciate the breakdown!

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

    Me : I Will Be Productive In Quarantine
    Meanwhile Me At Quarantine :

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

    What a brilliant way to explain the trick without talking or having to do draw kind of confusing workflow to show. Nice! Great tutorial, though youtube randomly recommended me this for no reason lol.

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

    This certainly is an underrated channel

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

    unitys particle system smash wish list on karlson were almost the top ten

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

    Really clever, but I’d like to see the performance for a lot of conveyor belts. Also, it wouldn’t impart a reverse direction for the underside of the conveyor belt, i think that’d be a cool problem to solve.

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

      Regarding the underside, the idea is to add a separate conveyor script to each to the four parts in the diagram at 1:56, including the circular rotating ones. Though instead of using rigidbody.position and rigidbody.MovePosition on the circular parts, you would use rigidbody.rotation and rigidbody.MoveRotation.

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

    I do not do 3D or games in my life, but I know how to recognize a qualitative video, this is part of it.

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

    Video style and narration are A+

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

    This is the best code for unity conveyor belt. you are amazing. thanks for your share from far away.

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

    This is definitely some physically correct conveyer belts in unity

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

    This is a great way to end up with weird glutches on the long run

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

    the drum on the music reminds me of that one web where you can watch weird stuff, the logo is like the old youtube logo but orange

  • @akshat8586
    @akshat8586 3 ปีที่แล้ว +4

    Remember when SOURCE Engine introduced this first it looked like magic back then you know the VALVE Era..... Half Life 2, TF2, L4D etc Come on u know who is valve !!!!

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

      Clicked this video just to see if someone already said it.

  • @gunbowling2-vrgamedevlog682
    @gunbowling2-vrgamedevlog682 3 ปีที่แล้ว +1

    i saw april 1st and thought this was a joke, but then saw 2020, the year april fools was silently canceled. good work

  • @PinkeySuavo
    @PinkeySuavo 22 วันที่ผ่านมา

    perfect video to watch at 06;30 am that i will never ever use in my entire life

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

    Oh, this is way better than moving platforms

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

    this will be on everyone’s recommendation

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

    What I learnt from this video: the belt is a lie.

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

    You could also set rigidbody.rotation then MoveRotation if you want objects to fall on a collection of spheres that move them along.
    If you set rigidbody to non-kinetic and set constraints to freeze rotation but not position, it can act like a ball motor for moving a capsule ( that has constraints for rotation ) as a connected anchor using a configurable joint resulting in a rigidbody character motor - AddTorque in VelocityChangeMode is required NOT MoveRotation!

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

    U know, this is what all players of Satisfactory need

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

    wasn't looking for this but i needed it

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

    I am trying to create a coin pusher game, and I was having a problem where the coins would just sit stationary on top of the pusher collider, rather than move with it as it moved back and forth. I thought I had fixed this by using a script which adds a fixed joint on collision, however now the coin snaps and freezes in place as soon as it touches the pusher.
    I have been led to your video by chance, and it's given me a new way of going about this (hopefully). Thank you

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

      i am having the same issue did you ever resolve this if so how?

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

      @@UncleDennyPlays Was in same boat but worked it out. The key to getting this working is to set the conveyorbelt's rigidbody to IsKinematic.
      - Boxes that go on the conveyor need a rigidbody and a box collider, defaults settings work with no issue (so Rigidbody Mass: 1, Drag: 0, Ang Drag: 0.05, UseGravity: yes, IsKinematic: no)
      - Conveyor Belt object needs a rigidbody and a box collider.
      Rigidbody settings: Mass: 1, Drag: 0, Ang Drag:0.05, UseGravity: yes. IsKinematic: YES
      Box collider default settings work fine. Make sure the collider extends the length of your conveyor (e.g. if modelling it yourself).
      Also Note, if you have Physics materials on either object's colliders, make sure the friction values are greater than 0, and friction combine not set to minimum.

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

    can you drop a conveyor on another conveyor? namy naked slugs stack up to 4 layers high, for cover and for faster locomotion.

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

    Como haces la cinta'???

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

    Physically correct that this thing randomly popped up in my recommended

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

    When the conveyors are physically correct.

  • @achraf844
    @achraf844 3 ปีที่แล้ว +2

    How did he do that conveyors moving belts animation?

    • @Specoolar
      @Specoolar  3 ปีที่แล้ว +4

      UV scrolling

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

      @@Specoolar thank you so much man ! This one skipped my mind

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

    Im glad youtube recommended this to me

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

    So happy someone is showing the dimwits that it’s not difficult

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

    i was hoping for a tutorial for the animation too, but i was going to make tank tracks

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

    Unironically this is a really good tutorial

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

    From interesting to learning something

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

    I have no use for this but it fascinates me

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

    Airport baggage conveyors be like

  • @harryag.
    @harryag. 3 ปีที่แล้ว

    Thats how they deliver my luggage on da plane

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

    Man imagine this from 11 year ago instead 11 month ago, that would be amazing yet surprise

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

    Now I got a solution to a problem I don't have. Thank you YT algorithm.

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

    I just use Unity for 3D models for a virtual reality social platform. This level of science and mathematics is beyond me

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

    The model is absolutely amazing I want to use it

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

    Even though I have no idea this is still the video to watch

  • @perfectketchup
    @perfectketchup 3 ปีที่แล้ว +2

    physics is trivial here, question is how do you do the belt animation?

    • @Specoolar
      @Specoolar  3 ปีที่แล้ว +2

      UV scrolling

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

      So texture offset basically Thanks.
      Glad to know there isn't any deformable mesh kinematics and such looks pretty realistic with such a simple approach

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

    why the hell did i find this RIGHT AFTER i quit game development. still gonna save this incase i start again.

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

    Unity handles around 1000~2000 rigid bodies, this and with some good depth item rendering, you can make a really good factory game
    *on a slightly below average pc

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

    see guys, its not just a friction-less surface with a windbox attached

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

    You need to add rb.rotation and make it kinematic to make it perfect!

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

    that is some 200IQ teaching skillz

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

    Can we make this with rotation? I tried lot of things, played with friction, mass, drag, gravity values but boxes flip away from the belt when I use MoveRotation. Is there any way to work it with rotation too?

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

    Dont know why i was recommended this but hey, who doesn't love physics

  • @white_145
    @white_145 3 ปีที่แล้ว +2

    Я в 8 вечера: сегодня точно лягу спать пораньше
    Я в 3 часа ночи:

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

      привет , у тебя все работает ? Если да , то на какой версии юнити ?

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

    I'm guessing since its done in unity this could be implicated into a vrchat world?

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

    I successfully applied conveyor belt movement but can't apply the skin. Can anyone help me to make conveyor belt look just like this please!

  • @janinel.4193
    @janinel.4193 3 ปีที่แล้ว

    I like that. I really like that. Now we need to find a use

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

    That's some sticky conveyor belt

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

    This hurts after playing Satisfactory 24/7

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

    Why not do
    cube.GetComponent().AddForce(direction * speed, ForceMode.Force);
    when anything collided conveyor? And check if Cube's speed did not exceeded limited? Way shown in the video doesn't seem to be intended.

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

    I don't Unity at all but if I did, I would say you explained it perfectly

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

    Why it feels like a 2009 video?

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

    Now i want 3d factorio

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

    So they are literally just vibrating very fast?

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

    That was really useful thank you!

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

    but does jumping cancel the momentum

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

    This video: This is how conveyors are
    Roblox Tycoon Games: *WRONG*

  • @EvokerKing
    @EvokerKing 3 ปีที่แล้ว +2

    who else only sees this bc they watch dani and it came into there recommended

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

    I hope this works in 2D too, so I can use this to make better moving platforms for my game!

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

    If conveyor belts in Satisfactory works like this it will never reach its end point especially when youre using anything higher than a MK 2

  • @Alexander-kf2wv
    @Alexander-kf2wv 2 ปีที่แล้ว +1

    well, has anybody found the model\texture link? could you share please?

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

    This is big brain programing

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

    This is pretty freaking cool!!!

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

    Apparently also visually accurate.

  • @Sagaan42
    @Sagaan42 3 ปีที่แล้ว +4

    Oh my god this is an INSANE cheat!!

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

    the octave up note on the bass is a flat ninth, maybe microtonally detuned, and it sounds terrible

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

    *PRO TIP:*
    Use *Rigidbody.rotation* and *Rigidbody.MoveRotation()* to make circular conveyor belts

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

    I love the beach party music

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

    Fascinating

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

    I cant get the objects to change direction based on the rotation of the conveyor. The objects move in the same direction no matter which orientation the belts are in... Any ideas...? Script and set up look identical.

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

      Use transform.forward instead of Vector3.back

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

    would you happen to know why my character doesn't move on the conveyor? He has a capsule collider character controller would they need a box collider touching the ground?

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

    is a conveyor belt jiggling back and forth correct tho

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

    Setglobalpose vs setkinematictarget, do i win something now?