How to make a Swim System like Fallout (Unity Tutorial)

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ธ.ค. 2024

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

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

    Updated and improved version of the code is now on our Patreon www.patreon.com/JTAGamesInc. It's much better with much cleaner code. Thanks!

    • @ryanw5500
      @ryanw5500 3 หลายเดือนก่อน

      The link doesn't work.

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

    For some reason my character can only move forward and back on the Z axis..
    it wont allow me to move in the direction that i'm facing :(

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

    This works really well, but I had one issue. I couldn't move up and down in the water! But I found my solution and maybe I could help someone out.
    I placed my target object in front of the player but I noticed that as I moved my player's cam around, the target wouldn't move up and down, and the script is designed to move the player where the target is, which is why I wasn't able to go up and down. However, I placed it as a child in my main camera, which made the target move accordingly with the camera, basically meaning that wherever I looked, the target would move at that position. I offset the target on the z axis when I put it as a child of the camera.
    So make sure your target object is moving up and down when you look up and down or you won't swim in the desired direction!

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

      I could have sworn I mentioned that in the tutorial. If I didn’t then yes please this will only work if it’s a child object of the object that is being moved which in this case is the camera

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

      I have my main cam with different cinamachines for third person , third person combat , third person top down, and fps and every works awesome thanks to you its only the top down view which i cant use with this swimming but youre comment helped me more the struggling a day with chat gpt XD

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

      @@reaporofdragon744 no problem dude :)

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

    Hi! I followed the tutorial completely but for some reason I just fall through the water object, is there any way I can fix this? Thanks.

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

    i jump in and i just fall

  • @mexix2965
    @mexix2965 2 ปีที่แล้ว +1

    I get so many errors and i dont know how to fix them. Pls paaste the codes to video description

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

      Our code will eventually be available to our patrons. www.patreon.com/JTAGamesInc
      It's going to take some time to back catalog.

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

    can i use this to work in a third person controller? i have my own third person movements i just want a swimming system

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

      Kind of. You would need to adjust your third-person controller to move freely without gravity if 'isSwimming' is turned on. That would be the only difference, and unfortunately, it isn't the same as first-person movement version for free moving through 3D space.

  • @nickmalialis6
    @nickmalialis6 2 ปีที่แล้ว +1

    Hello.
    Would this logic still work if it were a 2D side Scroller ? I would like to make some portions of a metroidvania game include some underWater areas. My character does have a Rigidbody2D so i feel like it might work. Thank you for a great tutorial.

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

      Sort of. I think there are tutorials specifically for side scroll swimming though. They probably won’t be as “to the point” as our tutorials are but I would just try different things until you get something that works for your project.

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

    How do you fix the FirstPersonController from jumping on the Water?

    • @JTAGames
      @JTAGames  2 ปีที่แล้ว +1

      Is the players layer set to “EyeLevel”

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

      @@JTAGames The First Person Controllers layer is set to Default and the Tag is on Player

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

      @@cupded you probably didnt set the water collider to isTrigger