Buoyancy with Unity Rigidbodies - Part 2 / Waves

Поделиться
HTML-код
  • Опубликовано: 19 сен 2024

Комментарии • 93

  • @HomeGameCoder
    @HomeGameCoder 2 года назад +1

    Thank you for the tutorials. This is exactly what unity should have implemented years ago in a default "buoyancy collider". The number of likes in this video is not proportional to the quality of the information given... you need millions! These two tutorials should be the first result if you search "unity boat on water"... it just took me 1 year to find this information.... Once again, thank you!

  • @altugozhan
    @altugozhan 2 года назад

    there are a bunch of buoyancy methods but your method looks the most efficient and most cpu friendly way to do it. Great work!!!

  • @MaxIme555
    @MaxIme555 2 года назад +3

    *_Love the tutorials and love you game! I would love a tutorial on how you setup the lighting and atmosphere in your game (fog, floating particles...)._*

  • @FriendFactory
    @FriendFactory 2 года назад

    This needs more views, so good.

  • @RauBoSo
    @RauBoSo 3 года назад +1

    It's amazing, very cool tutorial

  • @petremlabs
    @petremlabs Год назад +6

    If you have objects floating like I did, try changing the WaterHeightAtPosition to
    return ocean.position.y + displacementWaves.GetPixelBilinear(pos.x * waveFrequency* ocean.localScale.x, (pos.z * waveFrequency + Time.time * waveSpeed)*ocean.localScale.z).g * waveHeight;
    It is more correct to put the multiplication of localScale.x,z inside the GetPixelBilinear, to take into account if you rescaled the x,z dimensions of your water plane.
    Great tutorial though.
    Cheers,
    PetRem Labs

    • @joshuairvin9661
      @joshuairvin9661 Год назад +1

      You are the MAN! That was the fix needed to properly scale with ocean plane scaling. Comes in handy when applying weather systems to smoothly change the scale of the waves. Thanks!!!

  • @munyunu
    @munyunu Год назад

    Mind blown thank you

  • @thepanameniac4855
    @thepanameniac4855 2 года назад +2

    Hey man, I'm having a problem with the bouys. For some reason is floating over the water

  • @shrippie-4214
    @shrippie-4214 3 года назад +11

    these videos are amazing why no comments btw can i have the water shader i already made one
    and it isn't working with it

    • @Mona-tn8mj
      @Mona-tn8mj 3 года назад +2

      Thank you ! I don't have it anymore sadly... You should be able to copy it from the video though (from 2:28 of the first part of the tutorial, I show the node graph)

    • @abdurrazzaque8435
      @abdurrazzaque8435 2 года назад

      can you like write the code of ocean manager

    • @shrippie-4214
      @shrippie-4214 2 года назад +1

      @@abdurrazzaque8435 lol i switched game engines a few months ago

    • @catsEeter
      @catsEeter 2 года назад

      @@shrippie-4214 what did you switch to

    • @shrippie-4214
      @shrippie-4214 2 года назад

      @@catsEeter Godot

  • @gerardoArF
    @gerardoArF 2 года назад

    Thank You! i have learn a lot :)

  • @livelively3845
    @livelively3845 11 месяцев назад

    Thank you so very much!

  • @mohamedhamed3572
    @mohamedhamed3572 Год назад

    Amazing!

  • @andrewwestermann8786
    @andrewwestermann8786 2 года назад +3

    This is great but i'm having an issue. My cube just floats up way above the waves. I think the code is telling it the waves are much taller than the shader makes them appear. Code is 100% the same as yours and everything in Unity is set up the same. Maybe it has to do with the Normal Map? Guessing that because I know nothing about them and just grabbed some off the unity asset store.. Any ideas would be much appreciated!
    EDIT: I Got it!!! My issue was my ocean plane game object had different scales for x / y / z. Once i changed them all to 100, the boat floated on the waves correctly. Hope this helps someone.

    • @CGC_Studio
      @CGC_Studio Год назад

      Check you water plan is in y = 0😀

  • @TheGamingzombie1
    @TheGamingzombie1 Год назад +2

    This tutorial really helped me get my water physics working perfectly! I have a question though.
    I'm generating my wave displacement using multiple sine waves and some gradient noise. The biggest thing I could use from this tutorial is the Texture.GetPixelBilinear function, but as you'd guess. I'm not using a texture to generate anything. But I need to get the info from the the shader of the height of each vertex. How would you recommend approching this? I've been researching documentation for a couple weeks now but can't think of anything that would get me something similar!

    • @MrApollo_
      @MrApollo_ Год назад +1

      Did you figure anything out on this? Im also creating my waves this way, and need to get the wave height from the shader somehow to use in the script.

    • @emrekiratli2614
      @emrekiratli2614 11 месяцев назад

      same here, i think that's why in the tutorial noise is generated outside the shader graph.

    • @ouria1722
      @ouria1722 7 месяцев назад

      same fore me

  • @brodakarat6340
    @brodakarat6340 2 года назад +2

    How did you make that circular mesh thats more detailed near the middle?

  • @atilliator
    @atilliator 2 года назад +1

    Enjoying your tutorials. However same issue of objects falling thru the ocean @13:45
    but the strings are the same. Any ideas?

  • @sev8798
    @sev8798 3 года назад

    Sgned up! Congratulations on your tutorials and your project! Will you take a tutorial on how to optimize a thick vegetation in HDRP? unfortunately there is really little stuff around...

  • @iR3dy
    @iR3dy 3 года назад +8

    Quick question, you use a normal map to make your water so you use an 2d texture lod node, in my shader, instead of using that I use a gradient noise node and it seems to do the same thing. so my issue is how do I reference that over how you're referencing the 2d te3xture?

    • @sollner_fox
      @sollner_fox 2 года назад

      Did you find answer?

    • @iR3dy
      @iR3dy 2 года назад

      @@sollner_fox no, sadly... kinda sucks but hey all good

    • @mikeohc
      @mikeohc 2 года назад

      @@iR3dy Maybe normal from height node? The problem is that the normal will be pixelated when using that node.

  • @فارس-م9ش
    @فارس-م9ش 2 года назад +2

    It's not working with mesh colliders unless I freeze x,y,z rotations in the rigidbody constraints which won't be a good solution.

    • @MrApollo_
      @MrApollo_ 11 месяцев назад +1

      Did you find a fix for this?

    • @sliceofanime8614
      @sliceofanime8614 10 месяцев назад

      @@MrApollo_ I'm also looking into it.

  • @romaniandude7307
    @romaniandude7307 2 года назад +1

    Hello! if there's anyone experienced enough or knows how to get by this please help! I already have an ocean shader and all the variables are managed through the material on the ocean. I've tried implementing the ocean manager script and I simply can't get it to work. The video I followed was: How to implement Gerstner Waves with Shader Graph in Unity by Zicore. If anyone can help match the variables to the buoyancy script in this video, please respond.

  • @kirkshamrock9906
    @kirkshamrock9906 Год назад +1

    Is your shader available for free?

  • @Ragwadada
    @Ragwadada 2 года назад

    🔥🔥🔥🔥

  • @KingDoogan
    @KingDoogan 2 года назад +1

    Any chance you could make a boat/sail mechanics tutorial to go with this? i've been trying to figure out boat movement and it hurts my brain

    • @blanketparty5259
      @blanketparty5259 Год назад

      Shouldnt it just be like a regular character controller ? I imagine you just connect the floaters on to each corner of the boat and thats it

    • @KingDoogan
      @KingDoogan Год назад

      @@blanketparty5259 Yeah I've done some tests and researched since then, a normal ridgedbody character controller works fine \m/

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @Marg.g187
    @Marg.g187 11 месяцев назад

    do you have source code or a unity project available?

  • @LearnWithArjun
    @LearnWithArjun 2 года назад

    Can u plsssssssssssssssssssssssssss give a link for the project?

  • @MasterOfCookie
    @MasterOfCookie 2 года назад

    So I think I did everythiright, but the things float way higher, it's like the point that they should be at is multiplied by something? can anyone help?

    • @N0tTh3Pr0
      @N0tTh3Pr0 2 года назад

      try reducing the water height

    • @MasterOfCookie
      @MasterOfCookie 2 года назад

      @@N0tTh3Pr0 The problem is: water height 0, acts like no waves, I put waterheight to 10, and the wave is at y 7 for example, the thing is trying to float at 14, if water is 14 it tried to float at 28, not with theese numbers, but you get the point

  • @tornikedevdariani
    @tornikedevdariani Год назад

    People that are having problems with scaling just use two planes set the main one to 1:1:1 and hide it, make the visible one as big as you want but make sure y scale is 1 and that will fix your problem

  • @AF-ei5yi
    @AF-ei5yi 3 года назад

    Shame this can't be done with regular unity. I tried to install that render pipeline and it balls up my project and pissed away 5 hours. Thank god i saved a copy before i started

    • @forasago
      @forasago 2 года назад

      there are better ways to do 3D waves any way. the physics in this video can be done with any version of Unity.

  • @ahmadgamal65
    @ahmadgamal65 2 года назад

    Can this work with urp?

  • @Garyson-cm8xk
    @Garyson-cm8xk 4 месяца назад

    It's cool, but in the first tutorial he shouldn't have did a time laps

  • @mikedev5263
    @mikedev5263 2 года назад

    Where r u ?

  • @brunogalarraga6412
    @brunogalarraga6412 2 года назад

    Could you simuling a ship launching go down into slope 1° o 3° to sea o river. Ship length about 72m and airbags put down the ship (rotating + cinematic) moving?. Here include gravity force!

  • @khurum
    @khurum Год назад

    How do I add underwater and foam and caustics

  • @damirshabayev344
    @damirshabayev344 3 года назад

    damn can someone send the project pls i tried doing this 4 times and all of them had something wrong with them(never did textures and shaders)

    • @madd0g3777
      @madd0g3777 3 года назад

      yeah i second that.

    • @officialgSync
      @officialgSync 2 года назад

      u have to make the shaders so it works

  • @Hyphen3372
    @Hyphen3372 3 года назад

    the objects go to high and idk how to fix it

    • @sollner_fox
      @sollner_fox 2 года назад

      Did you fix that?

    • @werkhaye
      @werkhaye 2 года назад

      same issue floaters move way slower than the waves and stay higher

    • @werkhaye
      @werkhaye 2 года назад

      Actually I fixed it, but i don't know if it is the same problem for you. In the WaterHeightAtPosition method, I misswrote the formula, instead of putting position.z * waveFrequency + Time.time * waveSpeed, I put position.z * waveFrequency * Time.time * waveSpeed -> so I put a * instead of a + between waveFrequency and Time.time. Hope it helps !

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @LearnWithArjun
    @LearnWithArjun 2 года назад

    Can u plsssssssssssssssssssssssssss give a link for the project?

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @LearnWithArjun
    @LearnWithArjun 2 года назад

    Can u plsssssssssssssssssssssssssss give a link for the project?

  • @LearnWithArjun
    @LearnWithArjun 2 года назад

    Can u plsssssssssssssssssssssssssss give a link for the project?

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

    • @catsEeter
      @catsEeter 2 года назад

      OH MY LORD STOP SPAMMING

    • @abdurrazzaque8435
      @abdurrazzaque8435 2 года назад +1

      @@catsEeter NO ONE IS SAYING THE CODE

    • @catsEeter
      @catsEeter 2 года назад

      @@abdurrazzaque8435 I DONT CARE BUT STOP ITS ANNOYING TO OTHERS

    • @abdurrazzaque8435
      @abdurrazzaque8435 2 года назад

      @@catsEeter IGNORE IT

    • @catsEeter
      @catsEeter 2 года назад

      @@abdurrazzaque8435 JUST STOP

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager

  • @abdurrazzaque8435
    @abdurrazzaque8435 2 года назад +1

    can someone like write the code of ocean manager