Unity 2D Cloth! No Code Needed!

Ойындар

Due to popular reddit request, I made a tutorial video on 2D cloth physics. This method requires no code, and looks really great!
Buy me a coffee: ko-fi.com/thatoneunitydev
Link to Kenny's platformer pack:opengameart.org/content/platf...
------------------------
My Setup
PC: amzn.to/499LOMd
Drawing Tablet: amzn.to/3uhegNe
Microphone: amzn.to/4bqWkjX
Keyboard: amzn.to/3SvA2EV
Mouse: amzn.to/3wiriKF
Headset: amzn.to/3whZwxU
Desk: amzn.to/42Cot3w
Chair: amzn.to/489RIfc
Note: These products won't cost any more money than they typically would, but by clicking the link as an Amazon Associate, I earn commission from qualifying purchases.
------------------------
Timestamps
0:00​ Introduction
0:19​ Project Setup
0:30​ Sprites
0:55​ Bones
2:01​ Adding Components
2:46​ Linking The Bones
3:59​ Settings
4:23​ Attaching The Cloth
4:40​ Physics Layers
5:13​ End Result
5:47 Final Thoughts
6:18 Outro
Music:
► Music Credit: 'Low Frequency Music'
Track Name: 'Isolated Aren't We All'
Music By: Low Frequency Music
Official "Low Frequency Music" SoundCloud HERE - / user-551516820​
Official "Low Frequency Music" KZread Channel HERE - / lowfrequencym...​
Official "Low Frequency Music" Spotify HERE - open.spotify.com/artist/5BGRZ...
DOWNLOAD @ www.chilloutmedia.com/low-fre...
License for commercial use: Creative Commons Attribution 4.0 Unported "Share Alike" (CC BY-SA 4.0) License.
Full License HERE - creativecommons.org/licenses/...
Music promoted by NCM goo.gl/fh3rEJ​ @
www.LoFi-HipHop.com

Пікірлер: 37

  • @kailenhoward4764
    @kailenhoward47645 ай бұрын

    I edited the skin so there is one vertex per bone and changed the joints to 'Distance joint 2D'. then clicked Max distance only. also switched the attachments to 'Fixed Joint 2D'. tweak the rigid body. it looks a little more organic now . Thanks for making this video learned enough to get where I was going

  • @ThatOneUnityDev

    @ThatOneUnityDev

    5 ай бұрын

    Glad you liked it! :)

  • @maykerodrigues8041
    @maykerodrigues80413 жыл бұрын

    Nice tutorial. Thanks for sharing this. I would love to see more of your works.

  • @ThatOneUnityDev

    @ThatOneUnityDev

    3 жыл бұрын

    No problem! :) Happy to share!

  • @F.T.L
    @F.T.L3 жыл бұрын

    Man you really saved my life. You should have a lot of subscribers. Explanation is really good, and i cant find even one thing on internet. Everyone suggests to make it in blender and then export it to Unity. Thanks for this really.

  • @ThatOneUnityDev

    @ThatOneUnityDev

    3 жыл бұрын

    Thanks so much for the kind words! I'm glad it helped! :)

  • @blooowl
    @blooowl3 жыл бұрын

    Thanks for making this! I really thought it'd be too difficult/time consuming but you made it very digestible!

  • @ThatOneUnityDev

    @ThatOneUnityDev

    3 жыл бұрын

    Thank you very much! I'm glad you liked it :)

  • @Wisdawms

    @Wisdawms

    Жыл бұрын

    That's what she said I'm sorry

  • @nikhilvardhantawania4591
    @nikhilvardhantawania4591 Жыл бұрын

    Man you should have a million views or something

  • @ThatOneUnityDev

    @ThatOneUnityDev

    Жыл бұрын

    haha thank you :)

  • @rishabh999100
    @rishabh9991003 жыл бұрын

    F"king brilliant

  • @StickyLabDev
    @StickyLabDev Жыл бұрын

    kinda good

  • @user-rp5or1ik5l
    @user-rp5or1ik5l2 жыл бұрын

    Didn't work quite nicely with me, the cloth joints connected to the background, I probably did something wrong but how do i fix it?

  • @ellucas5442
    @ellucas544211 ай бұрын

    hello, when I try to put the bones it doesn't let me, I don't know why, maybe it's a bug in the latest version

  • @WilemII
    @WilemII2 жыл бұрын

    Thanks! Do you know a way to add a random sprite in the cape so it can be deformed? (Not changing the cape sprite at all)

  • @ThatOneUnityDev

    @ThatOneUnityDev

    2 жыл бұрын

    Hmmm, I'm not to sure it's possible without looking odd, unless you repeat the same process as the cape, and try attaching it via spring joint, but even then it might look off.

  • @clode469
    @clode4692 жыл бұрын

    Do you think this would be possible to achieve in godot?

  • @virendrabhoriwal426
    @virendrabhoriwal4263 жыл бұрын

    Really great tutorial ! But how would you achieve resetting these animated object or SpringJoints2D??? animated object to its initial bone positions... ??

  • @virendrabhoriwal426

    @virendrabhoriwal426

    3 жыл бұрын

    If we want to do it during runtime??

  • @ThatOneUnityDev

    @ThatOneUnityDev

    3 жыл бұрын

    I'm not to sure if I'm understanding the question correctly. If you wanted to disable the real-time cloth you could just make arrays for all the joints, one for all rigidbodies, and one with their original positions. In Start() set the original positions, then when your ready to disable it, remove the object in the connected body slots of each joint, make the rigidbody's kinematic, and finally reset their positions. To re-enable it, just do the opposite. Hopefully that helped :)

  • @virendrabhoriwal426

    @virendrabhoriwal426

    3 жыл бұрын

    @@ThatOneUnityDev Thank you for your reply. I will try to code like that..hopefully it should work. Just liked plus subscribed...:)

  • @bobooso1913
    @bobooso19133 жыл бұрын

    It works almost perfectly but my character keeps getting pulled back because of the cape

  • @ThatOneUnityDev

    @ThatOneUnityDev

    3 жыл бұрын

    You can try to adjust the gravity, and mass of the rigidbody2D's that are on the cape, hopefully that helps! :) ... An alternative would be to make a script that limits the velocities so you don't get that pulling effect. In the demo I showed, I had very little mass and gravity scale to avoid that issue. :)

  • @ahsanulirham7765
    @ahsanulirham77652 жыл бұрын

    How to make that is so smooth like on 5:53 position?..... Please answer this message.....

  • @ThatOneUnityDev

    @ThatOneUnityDev

    2 жыл бұрын

    I literally did everything I showed in the video. :)

  • @hosamgalal4688
    @hosamgalal46882 жыл бұрын

    Hello, thanks for the toturial but it's not working for me, i followed the video and i have problems , the cape doesn't move with the character unless i attach it to the character, and even tho it fall down like a piece of cloth and don't work the way you show in the video, any idea what's wrong here? Thanks again and hope you will reply to this ....

  • @ThatOneUnityDev

    @ThatOneUnityDev

    2 жыл бұрын

    I think you might have missed the step at 4:23 where I attach the cloth to the player with joints. Hope I helped :)

  • @hosamgalal4688

    @hosamgalal4688

    2 жыл бұрын

    @@ThatOneUnityDev no , I did it really, I attached both bones in the top corners

  • @YigitEfe_
    @YigitEfe_2 жыл бұрын

    Can we do these in pixel sprites? If I continue to made physics by hand frame by frame I’m gonna throw my self from window

  • @ThatOneUnityDev

    @ThatOneUnityDev

    2 жыл бұрын

    Yes, it should work for pixel art lol

  • @user-xc6sk4xm6b
    @user-xc6sk4xm6b3 жыл бұрын

    Don't know why but my bones keeps falling down on movement far away from connected player

  • @ThatOneUnityDev

    @ThatOneUnityDev

    3 жыл бұрын

    Are you sure your bones are setup correctly? Perhaps the force of your movement is to much for the joint to handle, your cloths rigidbodies could be to heavy, or it could be colliding with the player still. Hopefully I helped! :)

  • @user-xc6sk4xm6b

    @user-xc6sk4xm6b

    3 жыл бұрын

    @@ThatOneUnityDev didn't solve it, I tried to implement exactly like you with plain square and I came up with bones not keep up to player. I tuned up in various ways all settings (mass, freq, damping, anchor points and etc.) And best scenario i had is cloth just spinning around player at furious speed 😀. I'll try different bones structure with verlet integration.

  • @kailenhoward4764

    @kailenhoward4764

    5 ай бұрын

    I know its late but did you select Auto Configure Distance?@@user-xc6sk4xm6b

  • @Omnivoid22
    @Omnivoid22 Жыл бұрын

    I know this is old but this should work with hair , right?

  • @ThatOneUnityDev

    @ThatOneUnityDev

    Жыл бұрын

    I haven't tried it myself, but I would like to think so! :)

Келесі