Simple Wind Shader Effect in Unity!

✅ Get the Project files and Utilities at unitycodemonkey.com/video.php...
Let's learn how to make a simple Wind Shader effect in Unity! 👇
🌍 Get the Complete Builder-Defender Course! ✅ unitycodemonkey.com/coursebui...
👍 Learn to make an awesome game step-by-step from start to finish.
Make Awesome Effects with Shader Graph in Unity!
• Make Awesome Effects w...
Check out the entire Shader Graph Tutorials Playlist
• Unity Shader Graph Tut...
🌍 Get Code Monkey on Steam!
👍 Interactive Tutorials, Complete Games and More!
✅ store.steampowered.com/app/12...
If you have any questions post them in the comments and I'll do my best to answer them.
🔔 Subscribe for more Unity Tutorials / @codemonkeyunity
See you next time!
📍 Support on Patreon / unitycodemonkey
🤖 Join the Community Discord / discord
📦 Grab the Game Bundle at unitycodemonkey.com/gameBundl...
📝 Get the Code Monkey Utilities at unitycodemonkey.com/utils.php
#unitytutorial #unity3d #unity2d
--------------------------------------------------------------------
Hello and welcome, I am your Code Monkey and here you will learn everything about Game Development in Unity 2D using C#.
I've been developing games for several years with 7 published games on Steam and now I'm sharing my knowledge to help you on your own game development journey.
You can see my games at www.endlessloopstudios.com
--------------------------------------------------------------------
- Website: unitycodemonkey.com/
- Twitter: / unitycodemonkey
- Facebook: / unitycodemonkey

Пікірлер: 184

  • @CodeMonkeyUnity
    @CodeMonkeyUnity3 жыл бұрын

    🌐 Have you found the videos Helpful and Valuable? ❤️ Get my Course unitycodemonkey.com/coursebuilderdefender.php or Support on Patreon www.patreon.com/unitycodemonkey

  • @zakisellami8899

    @zakisellami8899

    3 жыл бұрын

    Can you teach us how to make a horse or a bike that you can climb over and use to increase your speed pls

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    @@zakisellami8899 I've covered several character controllers previously, they all use a simple float to manage the moveSpeed kzread.info/dash/bejne/dJqTl9OCpJytops.html

  • @zakisellami8899

    @zakisellami8899

    3 жыл бұрын

    I meant something like riding a horse in 2d games

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    @@zakisellami8899 The character controller doesn't care what visual is applied to it. You can move a Horse or a Character or a Brick.

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    ​@PueKio That's a very specific genre, you're better off breaking it down into it's base mechanics and look for tutorials on that. I've covered some Pathfinding you can use, a bunch of UI elements, Tooltips, etc.

  • @codegnatstudios
    @codegnatstudios3 жыл бұрын

    This video really blew me away.

  • @peppidesu

    @peppidesu

    3 жыл бұрын

    shut

  • @CASMANWHAT

    @CASMANWHAT

    3 жыл бұрын

    I see what you did there

  • 3 жыл бұрын

    I will carry this shader with me for the rest of my life

  • @CodeMonkeyUnity
    @CodeMonkeyUnity3 жыл бұрын

    💬 Have you ever made a Wind Shader effect? Once you start thinking in terms of textures/gradient/noise everything becomes much easier to do in Shader Graph. Stay tuned for the awesome Construction Shader I made for the course, it really looks awesome and it's quite simple to do!

  • @zakisellami8899

    @zakisellami8899

    3 жыл бұрын

    Can you teach us how to make a horse or a bike that you can climb over and use to increase your speed pls

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    I've covered several character controllers previously, they all use a simple float to manage the moveSpeed kzread.info/dash/bejne/dJqTl9OCpJytops.html

  • @ArmanNobari
    @ArmanNobari3 жыл бұрын

    This was one of the most useful tutorials I've seen in ~3 years of indie development with Unity. Seriously thank you for making this, for your instruction style, and for offering such a useful guide on YT!!

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    Thanks! I'm glad you found it useful!

  • @zionen01
    @zionen013 жыл бұрын

    This was one of the most well-explained video on shaders I've seen yet. I think you went over the details of every single node you added, in a well paced manner. Thanks for the video, I will be checking out your udemy course, I enjoyed your teaching style.

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    Thanks! I'm glad you enjoyed it!

  • @matteoscalvini
    @matteoscalvini3 жыл бұрын

    You are the chosen one. You are the next brackeys. Joking, you are not a replacement, you have been making those wonderful video and more for long time, and for this thank you. Just don't let us alone like brackeys ;)

  • @DarkMatterVisible
    @DarkMatterVisible3 жыл бұрын

    Fantastic tutorial, really well explained, and the perfect simple shader for building this effect and many others. Thanks!

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

    Wow! Exactly what I needed. Absolutely brilliant how you did this. Thanks!!!

  • @shizhencui5469
    @shizhencui54693 жыл бұрын

    I can always learn something new from this channel. Thanks a lot.

  • @thefrenchdev965
    @thefrenchdev9653 жыл бұрын

    This shader looks really solid! I will try to make one with your tutorial. Thanks!

  • @TheEenlampjebrandt
    @TheEenlampjebrandt2 жыл бұрын

    Well explained! Short and precise

  • @WanderyenErin
    @WanderyenErin2 жыл бұрын

    This is so cool!! Thank you for sharing with us

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

    I cannot thank you enough, just made my game look 100x better

  • @Tober_
    @Tober_3 жыл бұрын

    If anyone is having trouble with their sprite having a wierd shape, I have a solution. I wanted to apply this effect to my pixel art grass but when I apllied the material, my sprite turned into a wierd blob. To solve this, I went to sprite editor, in the upper left corner, selected "custom outline" and edited the outline of my sprite to my liking (with pixel art, you should turn on the "snap" feature ON as well (upper left corner)) Hope this helps someone, I struggled for quiet some time and it would be a shame not to use such a good shader and a tutorial :DDDD. PS: thanks for the wonderful tutorial, it helped me understand shaders better

  • @lachlandavies3574

    @lachlandavies3574

    6 ай бұрын

    oh my god thankyou so much

  • @acikgozemre
    @acikgozemre2 жыл бұрын

    Very helpful Thank you!

  • @manolov4074
    @manolov40743 жыл бұрын

    That is the same as in the Course !! :) Pretty cool

  • @stephenmackenzie9016
    @stephenmackenzie90163 жыл бұрын

    Awesome, thanks a million

  • @arcday4281
    @arcday42813 жыл бұрын

    Everything is at the highest level! By the way, it would be interesting to look at the mini course on "2D platformer" (slightly similar to the genre of "metroidvania"), if you ever want to do it )

  • @GG1440
    @GG14403 жыл бұрын

    Very good tutorial. Thank you.

  • @dr.jackshephard4733
    @dr.jackshephard47333 жыл бұрын

    Thanks for this excellent and concise explanation! That course of yours is very tempting, I may have to pick it up today :) I'm one month into my Unity dev journey so your work is invaluable, thank you!

  • @dr.jackshephard4733

    @dr.jackshephard4733

    3 жыл бұрын

    Welp, just bought it!

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    I hope you like it!

  • @dspartan007
    @dspartan0073 жыл бұрын

    Nice video, as always, very usefull.

  • @Soundy777
    @Soundy7773 жыл бұрын

    Concise & informative! You're a credit to gameDevs everywhere mon ami ^-^

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

    Fantastic. :)

  • @blendanimator6123
    @blendanimator61233 жыл бұрын

    Amazing

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

    You are best!

  • @mdmarufhowlader7036
    @mdmarufhowlader70363 жыл бұрын

    You are Awesome

  • @shadow-sea
    @shadow-sea6 ай бұрын

    amazing

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

    Thank you.... Thank you.... Thank you very very much... I tryed many shaders but Only by you I understand how object position Stop in x,z pos

  • @the7ak3
    @the7ak310 ай бұрын

    for some reason this video made my google speaker start listening around the 2:00 mark and it started playing Evanescence - Bring Me To Life lolol. Great vids btw

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    10 ай бұрын

    Really? that's odd, great song though!

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

    Great job on the video, I've been intimidated by the shader graph for a while now and this helped a lot. I'm going to check out your other shader graph tuts. Also, subbed :)

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    Жыл бұрын

    I'm glad the video helped you! Thanks!

  • @leptir1
    @leptir13 жыл бұрын

    Hey, another wonderful tutorial as always. Might want to fiddle some more with the render settings. There's a lot of distortion that happens around anything that's moving. Around your mouse, and around the character.

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    Distortion? You mean the Depth of Field effect?

  • @deeptiyadav923
    @deeptiyadav9233 жыл бұрын

    Just 30 min ago brackeys quit youtube are you sad,i cried 😭 But I think I will be fine as I have your tutorials .

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    Yeah that was definitely a surprise! He's been doing tutorials for 8 years so it seems like he's ready to try something new.

  • @pozzisoft6155
    @pozzisoft61553 жыл бұрын

    I was following so well! Then at 10:30 - Add this, multiply gradient by output of that, then add it up there. *Head explodes* Haha I LOVE your videos though! Keep doing what you are doing it helps in game dev so much to have people like you around!!

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    The tricky thing with making shaders is thinking in terms of number operations. By multiplying you are essentially using the gradient as a mask that is applied to the noise which means the noise only gets applied according to the mask. Then add that output just the same as before. It would be easier to understand if Shader graph showed the Noise as a flat texture rather than a sphere.

  • @pozzisoft6155

    @pozzisoft6155

    3 жыл бұрын

    @@CodeMonkeyUnity Ah that definitely makes sense! And by the way I should mention, to be fair I have not properly tackled shadergraph or tried it in my game yet, so to jump into this tutorial was already not the perfect way to go for me :) If I'm going to be serious about using this, I would do as you advised and start off with your other tutorial on the matter first! Great vid!

  • @alideveloper6945
    @alideveloper69453 жыл бұрын

    you are God Of Unity 2D

  • @williamrosengren3139
    @williamrosengren31393 жыл бұрын

    Yes

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

    Reminds me of Blender, dear me this is like a node bomb!

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

    Thank you very much! I have a question why sometime the wild shaders are moving super slower, so it can't even see ?

  • @phantomBlurrrr
    @phantomBlurrrr2 жыл бұрын

    Awesome shader. The only problem I have with it is that as the effect is applied, the pixels in the sprite are being warped. I assume there's a way to line up the vertex movement with the pixel resolution? Any ideas? That way as the sprite is bent the pixels size is kept more intact... Edit: I added a pixelation effect to this same shader and it seems to have helped keep the integrity of the pixels a bit better. My parameters ended up being Windintensity 0.25, Windspeed 1, Pixelation 65. Might help...

  • @NguyenHoangPhuong-qf6xb
    @NguyenHoangPhuong-qf6xb3 жыл бұрын

    I feel like a superman after this

  • @TheShelfman
    @TheShelfman11 ай бұрын

    Shaders terrify me, but this video was incredible. Thanks!

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    11 ай бұрын

    heh they are indeed tricky! Shader Graph is what helped me lose fear of shaders

  • @marymarin3506
    @marymarin35063 жыл бұрын

    Local multiplayer tutorial pleeeeeaseee)

  • @leptir1
    @leptir13 жыл бұрын

    I have a question: how do you get the background of your sprite to remain constant? It currently distorts the grass shader underneath. Thanks!

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    What do you mean by background of the sprite? A Sprite itself doesn't have any foreground or background.

  • @pinestark
    @pinestark3 жыл бұрын

    I have a problem moving the grass around. The shader seems to speed up when moving. any fixes?

  • @ayushjain1655
    @ayushjain16553 жыл бұрын

    When I link the texture to colour in Maintex at the start, some sort of highlighted aura has appeared of the green colour around my sprite. I am using the asset sprite provided in the link in the description. Please Help

  • @farn2388
    @farn23883 жыл бұрын

    I seem to be getting some warnings on this shader that say "implicit truncation of vector type" D3D 342, 699, 1052. Did I mess up a step or is it normal to have these warnings in the inspector?

  • @stoopochky
    @stoopochky2 жыл бұрын

    There is a problem that if my sprite is transparent when the parts move left and right, the opacity stacks. Some parts become different color and it looks a bit ugly. Is there a way to not add the transparency no matter how many layers are on top of each other? Thanks

  • @lyamwills7513
    @lyamwills75133 жыл бұрын

    Could you make a tutorial on bolt please because I don’t know what I’m really doing thank you

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    I made a Getting Started video for Bolt here kzread.info/dash/bejne/aq1qw82HhLjaYrw.html

  • @rennylmontuya3796
    @rennylmontuya37962 жыл бұрын

    Followed the steps correctly and when I apply it to the game object it does what its intended but the position does not show correctly on the scene? Any ideas?

  • @andragon
    @andragon2 жыл бұрын

    Hi. Followed the tutorial, but when I add this material with shader to more than 1 game object, all stops working. It works/animates fine when attached to 1 object only. In the shader main preview it looks great, but not when attached to more than 1 object. then it just does not animate at all. Suggestions?

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

    Getting some weird results when adding more than one game object with the same material. Seems to work perfectly fine with one. Googling around seems to indicate this is related to dynamic batching, although I can't find any option to disable it with URP shaders. Any ideas? Unity version 2022.2.18f1.

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

    how make tiling this shader for sprite sheet?

  • @NicoSteiner
    @NicoSteiner3 жыл бұрын

    These shader nodes are exploding so quickly in numbers. I think that's the price we have to pay for a kind of visual driven programming approach. Anyways - really good tutorial, thanks Code Monkey! I can see in your recording that you somehow managed to apply the Depth Of Field post processing effect to your 2D scene. I tried so too, but failed. Are you showing in your advertised course, how I have to build my whole scene to apply effects like this one? Or you maybe have another tutorial where this is explained? I would really appriciate having someone being able to explain, how to arrange my objects the right way to use such 3D-ish effects also in 2D.

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    My course is pure 2D so it doesn't have that effect, this scene is in 3D with flat sprites so I'm using the normal Depth of Field effect. I covered how to make custom post processing effects in another video and you could use that to make Depth of Field for 2D kzread.info/dash/bejne/aWuAxZZsqbe4ddI.html

  • @tripplejaz
    @tripplejaz2 жыл бұрын

    Hey Code Monkey, great tutorial. Just one question that I think would really add to the life of the plants; how would I create a random variable for the speed/intensity? That way it's not always "on" but the foliage would slow down at times, then pick up again, so the wind in the environment looks like it's actually moving through the space. Thanks in advance!

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    2 жыл бұрын

    For randomness you use some kind of Noise node, also use a Time node to scroll through it. Then remap that noise to some kind of wind speed value.

  • @tripplejaz

    @tripplejaz

    2 жыл бұрын

    @@CodeMonkeyUnity Thanks for the quick response. That worked exactly the way I wanted it to. One more question, the UV of some of my sprites (from a sprite sheet) is off, so the mask doesn't affect some of my foliage at the base, but others it does. Any idea how to adjust the UV of specific sprites?

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

    Ok I've found an issue at 10:40 the technique you use to 'pin' the bottom when sprites are in an atlas, which they almost always will be for a real-world project. Do you have a fix for this please?

  • @MarushiaDark316
    @MarushiaDark3163 жыл бұрын

    I know you can use Bools in Shader Graph, but Is it possible to use a Switch or Enum? For instance, if a wanted a dropdown menu to allow movement on "Only X" or "Only Y" but not having multiple properties that I have to toggle on and off, which can get hectic if there are many options in parallel.

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    I dont think theres any built in support for Switch or Enum, you really have to do complex boolean logic yourself.

  • @chrisheld8463
    @chrisheld84632 жыл бұрын

    Hi. Thanks for this video. I was succesful in getting the shader to work in the Shader graph and the editor; however, when I go inot play mode. The bottom is moving. It is almost like that last change of the shadder with the UV/Split/Preview was not added. Any ideas? I did make sure I saved and reloaded the material onto the sprite.

  • @chrisheld8463

    @chrisheld8463

    2 жыл бұрын

    I just realized what the issue was. I was using a sprite from a Sprite Atlas. So I guess the UVs are different when you use an atlas. I tested with a simple stand alone sprite and the effect was consistent between the Shader Graph Preview/Editor and the Player. Thanks again for the video!

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

    Thank you very much for the excellent video, I have a question: As a beginner, I have seen people use Animation (Animator component) before. So when to use Shader Effects instead? Which one is better? Again, I am a beginner, so I am sorry if my question is dumb. Thank you very much ❤

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    Жыл бұрын

    Animations are static, they always play the exact same animation. Whereas shader effects can use noise to make them more dynamic. They both have their use cases, really depends on the scenario.

  • @AbdAlrahman_Ghanem

    @AbdAlrahman_Ghanem

    Жыл бұрын

    @@CodeMonkeyUnity Thank you for the clarifications ❤

  • @Maurilustrador
    @Maurilustrador3 жыл бұрын

    How did you achieved that blur at the top like depth of field with sprites? the sprite renderer doesn't write to Z so the depth of field effect doesn't know which sprites are near the camera and which are further away. Thanks, and awesome vids by the way, subscribed!

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    It's the standard Post Processing depth of field. They are 2D sprites but it's a normal 3D scene, they are placed further away from the camera.

  • @touzimsky

    @touzimsky

    2 жыл бұрын

    @@CodeMonkeyUnity This does not seem to work for me. My 3D cubes get more or less blurry depending on their position, but the sprites remain blurry no matter how close or far I place them in the scene. My camera is already set to perspective mode. Any idea what I might be doing wrong?

  • @touzimsky

    @touzimsky

    2 жыл бұрын

    @@CodeMonkeyUnity I think I found the problem - the depth of field effect actually gets applied whenever a 3D object is at a point in 3D space, and that effect in turn also gets applied to the sprites sharing the same screen space as well. Once the plane is not rendered anymore all sprites are equally blurry.

  • @Maurilustrador
    @Maurilustrador3 жыл бұрын

    Also I wanted to ask. I have problems with sorting sprites when they overlap having my camera in perspective mode. Unity sorts by the pivot point of the sprite, but when I move my camera sideways they start to overlap each other (example: tree leaves between them in a tree) I can't use sorting layers because layers override the perspective of the camera if a character is behind or in front of another sprite in another layer. In your perspective example with sprites, how do you manage sorting?

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    If you use a perspective camera then you shouldn't touch the Sorting order, it should automatically be sorted based on distance to the camera. If you modify the Sorting order that's when you get those issues.

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

    Hello, can you give me advice on how to make this grass shader interact with player (character)?

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    Жыл бұрын

    Simplest way is add a collider to the grass and identify if the player is near grass, then pass in a parameter to the shader

  • @thefrenchdev965
    @thefrenchdev9653 жыл бұрын

    I have a question, do you think it's possible to make the shader react to the player's position? To make a sawing effect for a 2D game. I think I can send this value by script (as a Vector1 value) and maybe increase the amplitude of the oscillation when the distance is shorter but I'm not sure how to make it oscillating more in a direction (opposite to the player's pos). Is it possible to set a kind of offset to the oscillation? Thank you!

  • @thefrenchdev965

    @thefrenchdev965

    3 жыл бұрын

    Quick update: I have made it and it works really well!

  • @rajatkoparde5224

    @rajatkoparde5224

    3 жыл бұрын

    @@thefrenchdev965 can u tell me how u did it, i am trying the same

  • @thefrenchdev965

    @thefrenchdev965

    3 жыл бұрын

    @@rajatkoparde5224 I use the space coordinates as a variable for the shader I have made.

  • @redinternet9893
    @redinternet98932 жыл бұрын

    can i do the same to the 3D grass?

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    2 жыл бұрын

    Yup it should work exactly the same, as long as the grass has vertices it should work

  • @JustinFraser314
    @JustinFraser31410 ай бұрын

    Do you have an update of this now that Unity has updated the way they do shader graphs? Maybe in your course somewhere?

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    10 ай бұрын

    I believe the only difference is the alpha channel now being separate kzread.info/dash/bejne/k657r9eJac7ZaLg.html Everything else should work the same

  • @Cash_Online
    @Cash_Online3 жыл бұрын

    can I use that with URP

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    I am using URP in the video.

  • @ayushjain1655
    @ayushjain16553 жыл бұрын

    At the start when you link the texture to the colour (MainTex), I am following along in the same way, but in my preview as well as the scene/game, it is still showing pink colour which started to show as soon as I applied the material. Please Help

  • @ayushjain1655

    @ayushjain1655

    3 жыл бұрын

    Nevermind, fixed it! Didn't add a universal render assest to the project settings in Graph and Quality

  • @ibpositive757

    @ibpositive757

    2 жыл бұрын

    @@ayushjain1655 I'm having a similar issue, but I don't even see the Graph and Quality section in project settings. What Unity version were you using?

  • @angat7564
    @angat75646 ай бұрын

    Hi, your tutorial is great, but I have a question when I connect the MainTexture (asset selected) to Sample texture 2D and from Sample texture 2D to Fragment, the Main review does not show the materials that I select for MainTexture 2D. Could I ask where my problem is?

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    6 ай бұрын

    Do you see the preview on the Sample Texture node? Where did you assign the texture? On the Inspector or on the Shader Graph itself? The Shader Graph only assigns the defaults, it will be overriden by what is on the inspector

  • @angat7564

    @angat7564

    6 ай бұрын

    @@CodeMonkeyUnity Thanks so much for the support. I did it.

  • @VIT3Z
    @VIT3Z2 жыл бұрын

    Hi, I'm having a few problems with this. For some reason, it doesn't work with some of the sprites I have (which is very odd). I was able to get it working on some grass and tree sprites I have, but not on others. The second problem I'm facing is that I'm getting texture popping while moving the camera. The sprites appear when they're in the centre of the camera, but if they're on the edges they pop out. Is there a way to fix these problems?

  • @arnaudbistel5011

    @arnaudbistel5011

    Жыл бұрын

    @@UlarisBadler hi, I've got the same problem. Did you managed to solve it?

  • @georgehelms6332
    @georgehelms63323 жыл бұрын

    Hi

  • @FortbloxNET
    @FortbloxNET2 жыл бұрын

    Don't know if i am wrong, could it be, if the sprite is not a single file but from a tilesheet file, that it doesnt work as intended? i have the feeling the bottom is moving but in your shader you made it so the bottom should stay on its position, but you work with a single sprite file. could that be a problem when using a tilesheet? If yes, how would you fix that instead of making every sprite into one single file? thank you

  • @FortbloxNET

    @FortbloxNET

    2 жыл бұрын

    i added my test sprite to a single png file and it worked, so i assume, tilesheet makes the problem :-/ how could that be fixed? :-)

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    2 жыл бұрын

    Yes since the shader uses the texture position if you use a tilesheet it does break it One solution would be to have another tilesheet texture just in black and white gradient for each tile, then use that second texture as the position input instead of the uv position

  • @FortbloxNET

    @FortbloxNET

    2 жыл бұрын

    @@CodeMonkeyUnity i just tested out of fun, to make the sprite a single file, but then add to a sprite atlas which is literally the same as the spritesheet and it moves on X again :-/ i read about FLIPBOOK node but that would of course only work with the original spritesheet itself i assume? because on sprite atlas you dont know where the position of your sprite will be etc.... :-/ so only solution would be to make single png files and NOT add them to a sprite atlas, lol :)

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

    Could this work for grass on a tilemap as well?

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    Жыл бұрын

    Hmm if you use the Tilemap renderer then I don't think so since that one merges all the tiles into one mesh which means you can't use the mesh position to move the vertices

  • @smirkinmerkin4997

    @smirkinmerkin4997

    Жыл бұрын

    @@CodeMonkeyUnity That makes sense. I think I'm having a similar issue with using a texture atlas as well. The effect itself works great, but it looks like it's manipulating the vertices in relation to the entire atlas, not the individual slices. If that is the case, maybe this works best with individual textures? I'm new to Unity, so maybe I just need more experience with it, but it feels like it's better to not use texture atlases at all. There are cases where I can't select a slice as a texture, or (like with this) Unity doesn't treat slices as their own textures, even though I'm pretty sure it saves them as separate png files. Either way, I learned a lot from this. Your Ultimate Unity Overview has been very helpful too.

  • @ayushjain1655
    @ayushjain16553 жыл бұрын

    The 2d renderer doesn't appear in the shader menu, and I have everything necessary installed, including all the 2D packages and Universal RP. I'm using Unity 2020.3.4f1. Please help.

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    If you're using Unity 2020 then it simply shows up as Sprite Lit or Sprite Unlit

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

    Did anyone else encountered this issue: when the sprite (bush, grass etc) is moved around, the animation is sped up significantly? For example, when i apply this shader to an object in the foreground, the speed increases when my character moves, but when it stops, the vegetation's speed returns to the assigned values.

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    Жыл бұрын

    That's odd, the shader shouldn't care where the player/camera is, nothing in the shader is based on Screen Position

  • @philip47478

    @philip47478

    Жыл бұрын

    @@CodeMonkeyUnity So, after many tests, this issue appears only on orthographic view and parallax script applied on each layer group. Soon as i switched to perspective and removed the parallax script, the issue disappeared. Still not sure what caused this, since i tried many parallax scripts, and some were even from what unity packages had to offer.

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

    How does it work in 3d? There is no 2d texture and as 3d texture Unity finds nothing. :(

  • @thewar4yourmind356
    @thewar4yourmind3562 жыл бұрын

    I am having an issue using this tutorial, when i move the camera around the sprite does glitch. Not sure why, i'm using the object position but somehow when moving around the "trees" start glitching like if it reset it's position or something.

  • @thewar4yourmind356

    @thewar4yourmind356

    2 жыл бұрын

    Enabling GPU instancing fixed it for me.

  • @lack_05

    @lack_05

    Жыл бұрын

    @@thewar4yourmind356 I don't see the option on my material

  • @manolov4074
    @manolov40743 жыл бұрын

    will you make more udemy courses . I loooove the game that you created it is simply amaziiiing!!!!! U are awesome developer!

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    The response has been great so yup definitely planning on doing more. It's great to be able to make some full length projects rather than just quick videos.

  • @manolov4074

    @manolov4074

    3 жыл бұрын

    @@CodeMonkeyUnity I loved it . It is not only amazingly well explained but also the game is ACTUALLY NICE !!!! A great idea and well executed. I would love another course on showing more with shaders and some VFX for example like a mini rpg magic game (since those are very rough to make) But I trust that whatever you make will be excellent content with much to learn and of course , WORTH IT !!!! I highly appreciate you . Keep Crushing CODE monkey!

  • @MasterofFire-sc3yn
    @MasterofFire-sc3yn3 жыл бұрын

    How can I increase the UV effect so that I can use the effect for trees?

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    What do you mean by increase the UV effect? The UV of the texture isn't used for anything here.

  • @MasterofFire-sc3yn

    @MasterofFire-sc3yn

    3 жыл бұрын

    @@CodeMonkeyUnity The UV that is set to Channel0 at 10:13 that is used to make the effect only happen on the top.

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    ​@@MasterofFire-sc3yn What do you mean by increase the UV? If you don't apply that gradient mask then the effect is applied to the whole sprite. If you want to apply only to a specific part of a tree sprite you can make a custom texture mask instead of a simple gradient.

  • @Dannyxv8
    @Dannyxv83 жыл бұрын

    The 2d renderer doesn't appear in the shader menu, and I have everything necessary installed. I'm using Unity 2020.2.0f1

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    Do you have the Universal RP installed?

  • @Dannyxv8

    @Dannyxv8

    3 жыл бұрын

    @@CodeMonkeyUnity Like I said, I have everything installed

  • @ayushjain1655

    @ayushjain1655

    3 жыл бұрын

    @@Dannyxv8 did you get the soltuion?

  • @LePetit2
    @LePetit23 жыл бұрын

    For any reason, the 2d renderer menu doesn't appear in Create>Shader. Any idea why?

  • @LePetit2

    @LePetit2

    3 жыл бұрын

    Loved your tuto, btw!

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    Do you have the Universal RP installed and the 2D Packages?

  • @LePetit2

    @LePetit2

    3 жыл бұрын

    @@CodeMonkeyUnity Universal RP, 2d Animation, 2D Pixel Perfect, 2D PSD Importer, 2D Sprite, 2D SpriteShape and 2D Tilemap Editor. Just installed them and it doesn't appear yet.

  • @Zamoksva

    @Zamoksva

    3 жыл бұрын

    @@LePetit2 i didnt have it, then i installed universal RP and now its showing. try to instal it again maybe

  • @ayushjain1655

    @ayushjain1655

    3 жыл бұрын

    did you get the solution?

  • @AnkitPatel04
    @AnkitPatel048 ай бұрын

    Its not connecting and showing "argument Null emExepsion: Value cannot be null " help

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    8 ай бұрын

    Use Debug.Log to find out what is null unitycodemonkey.com/video.php?v=5irv30-bTJw

  • @Jaypordy
    @Jaypordy3 жыл бұрын

    Shader is working fine on 'Scene' mode but the color is black on the 'Game' mode. Any ideas?

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    Did you make a Sprite Lit shader? Do you have 2D lights?

  • @Jaypordy

    @Jaypordy

    3 жыл бұрын

    @@CodeMonkeyUnity Set up the 2D lights. It is working perfectly now. Thanks.

  • @nanomantube
    @nanomantube3 жыл бұрын

    I'm following the steps but I'm getting the error "material does not have _MainTex texture property" in the sprite renderer. I have _MainTex in the reference field in the shader. Therefore my object is just blacked out. Anyone know why?

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    Did you click Save on the Shader Graph? Is the reference name exactly right?

  • @nanomantube

    @nanomantube

    3 жыл бұрын

    @@CodeMonkeyUnity Ah that was it! I feel like a dummy. Thanks so much.

  • @DarkEspeon40K
    @DarkEspeon40K3 жыл бұрын

    Do you think this would work in a 2D environment with a tileset? :thinking:

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    This just moves the vertices so yes it's applicable to 2D Sprites as well as 3D Meshes

  • @DarkEspeon40K

    @DarkEspeon40K

    3 жыл бұрын

    @@CodeMonkeyUnity Lovely~

  • @derpenz5376
    @derpenz53763 жыл бұрын

    i am at 5:00 and my matirial is ony violet no matter what i do. Can anyone help me?

  • @derpenz5376

    @derpenz5376

    3 жыл бұрын

    On the Sprite is wirtten: _MainTex property needed, but i made that reference. Why is is not working?

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    Are you using URP or HDRP? Did you name the Reference _MainTex? Reference is different from the name

  • @derpenz5376

    @derpenz5376

    3 жыл бұрын

    @@CodeMonkeyUnity I have the Universal RP 10.3.1 Installed.

  • @derpenz5376

    @derpenz5376

    3 жыл бұрын

    @@CodeMonkeyUnity If I create a new material on the shader it is automatically violet.

  • @50Gameplay

    @50Gameplay

    3 жыл бұрын

    @@derpenz5376 same to me, have no solution

  • @svetlanasygiainen5339
    @svetlanasygiainen533910 ай бұрын

    I followed this to the dot, but alas for some reason game and scene do not render the Y vertex lock, so it's just a waving flag. Honestly, at a loss what is wrong here. Been trying to check my camera and settings, but it's just puzzling.

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    10 ай бұрын

    Are you using a spritesheet? Make sure you apply it to a simple solo sprite, otherwise the bottom won't match and everything will wave. The shader shouldn't have anything to do with the camera, the Y position is the base of the sprite and not screen space

  • @svetlanasygiainen5339

    @svetlanasygiainen5339

    10 ай бұрын

    @@CodeMonkeyUnity You're correct! Hooray, they were in an atlas. But It seems like I've also sneakily added them to another atlas. So when I was removing them in and out of first one, they didn't work correctly XD. Dunno if this should be used sparingly tho, considering they will need to be drawn induvidually now? But, it looks cool! Although in the light of the recent news, it's a small win. Either way, thank you for this awesome shader! It was a great learning experience :D

  • @zakisellami8899
    @zakisellami88993 жыл бұрын

    Can you teach us how to make a horse or a bike that you can climb over and use to increase your speed pls

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    3 жыл бұрын

    I've covered several character controllers previously, they all use a simple float to manage the moveSpeed kzread.info/dash/bejne/dJqTl9OCpJytops.html

  • @zakisellami8899

    @zakisellami8899

    3 жыл бұрын

    @@CodeMonkeyUnity I meant something like riding a horse in 2d games

  • @rxn7

    @rxn7

    3 жыл бұрын

    @@zakisellami8899 you can just increase player movent speed when player rides a horse

  • @nocultist7050
    @nocultist70503 жыл бұрын

    Will you join Odysee?

  • @gower1973
    @gower19733 жыл бұрын

    The algorithm that tessellates the mesh is pretty terrible that’s why it look ugly as sin, moving in z direction

  • @semithegamedeveloper6995
    @semithegamedeveloper69953 жыл бұрын

    Hey Code Monkey, Brackeys leaved in KZread Press like(for users) for Respect Press Love button(For Code Monkey) for Respect

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

    shaders are your worst side

  • @CodeMonkeyUnity

    @CodeMonkeyUnity

    Жыл бұрын

    How so?