Simple Wind Shader Effect in Unity!

Поділитися
Вставка
  • Опубліковано 17 лип 2024

КОМЕНТАРІ • 184

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  3 роки тому +10

    🌐 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 ua-cam.com/video/Bf_5qIt9Gr8/v-deo.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
    @codegnatstudios 3 роки тому +51

    This video really blew me away.

  • @CodeMonkeyUnity
    @CodeMonkeyUnity  3 роки тому +11

    💬 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 роки тому +2

      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 роки тому +2

      I've covered several character controllers previously, they all use a simple float to manage the moveSpeed ua-cam.com/video/Bf_5qIt9Gr8/v-deo.html

  • @zionen01
    @zionen01 3 роки тому +18

    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.

  • @ArmanNobari
    @ArmanNobari 3 роки тому +2

    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!!

  • @DarkMatterVisible
    @DarkMatterVisible 3 роки тому

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

  •  3 роки тому +19

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

  • @simmzzzz
    @simmzzzz Рік тому

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

  • @shizhencui5469
    @shizhencui5469 3 роки тому +1

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

  • @thefrenchdev965
    @thefrenchdev965 3 роки тому

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

  • @TheEenlampjebrandt
    @TheEenlampjebrandt 2 роки тому +1

    Well explained! Short and precise

  • @WanderyenErin
    @WanderyenErin 2 роки тому +1

    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

  • @matteoscalvini
    @matteoscalvini 3 роки тому +4

    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 ;)

  • @dr.jackshephard4733
    @dr.jackshephard4733 3 роки тому

    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!

  • @acikgozemre
    @acikgozemre 2 роки тому

    Very helpful Thank you!

  • @stephenmackenzie9016
    @stephenmackenzie9016 3 роки тому

    Awesome, thanks a million

  • @arcday4281
    @arcday4281 3 роки тому +1

    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 )

  • @dspartan007
    @dspartan007 3 роки тому

    Nice video, as always, very usefull.

  • @manolov4074
    @manolov4074 3 роки тому

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

  • @GG1440
    @GG1440 3 роки тому

    Very good tutorial. Thank you.

  • @Soundy777
    @Soundy777 3 роки тому +2

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

  • @leptir1
    @leptir1 3 роки тому +1

    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 роки тому +1

      Distortion? You mean the Depth of Field effect?

  • @leowilbur4024
    @leowilbur4024 Рік тому +1

    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 :)

  • @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

  • @edwardnewtonLA
    @edwardnewtonLA Рік тому

    Fantastic. :)

  • @voronkovmm
    @voronkovmm Рік тому

    You are best!

  • @Tober_
    @Tober_ 3 роки тому +9

    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

  • @mdmarufhowlader7036
    @mdmarufhowlader7036 3 роки тому

    You are Awesome

  • @blendanimator6123
    @blendanimator6123 3 роки тому +1

    Amazing

  • @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 ?

  • @pozzisoft6155
    @pozzisoft6155 3 роки тому +1

    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 роки тому +2

      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!

  • @shadow-sea
    @shadow-sea 5 місяців тому

    amazing

  • @the7ak3
    @the7ak3 10 місяців тому

    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

  • @phantomBlurrrr
    @phantomBlurrrr 2 роки тому

    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...

  • @leptir1
    @leptir1 3 роки тому +1

    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 роки тому +2

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

  • @pinestark
    @pinestark 3 роки тому +1

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

  • @alideveloper6945
    @alideveloper6945 3 роки тому

    you are God Of Unity 2D

  • @keenefx321
    @keenefx321 Рік тому

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

  • @farn2388
    @farn2388 3 роки тому

    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?

  • @ayushjain1655
    @ayushjain1655 3 роки тому

    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

  • @deeptiyadav923
    @deeptiyadav923 3 роки тому +9

    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 роки тому +9

      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.

  • @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.

  • @andragon
    @andragon 2 роки тому

    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?

  • @TheShelfman
    @TheShelfman 11 місяців тому

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

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  11 місяців тому +1

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

  • @stoopochky
    @stoopochky 2 роки тому

    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

  • @rennylmontuya3796
    @rennylmontuya3796 2 роки тому

    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?

  • @tripplejaz
    @tripplejaz 2 роки тому

    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 роки тому +1

      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 роки тому +1

      @@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?

  • @NicoSteiner
    @NicoSteiner 3 роки тому

    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 ua-cam.com/video/77Lc43yTREo/v-deo.html

  • @simonsays142
    @simonsays142 Рік тому

    how make tiling this shader for sprite sheet?

  • @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?

  • @williamrosengren3139
    @williamrosengren3139 3 роки тому

    Yes

  • @marymarin3506
    @marymarin3506 3 роки тому +3

    Local multiplayer tutorial pleeeeeaseee)

  • @MarushiaDark316
    @MarushiaDark316 3 роки тому

    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
    @chrisheld8463 2 роки тому

    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!

  • @NguyenHoangPhuong-qf6xb
    @NguyenHoangPhuong-qf6xb 3 роки тому

    I feel like a superman after this

  • @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  Рік тому +1

      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 ❤

  • @lyamwills7513
    @lyamwills7513 3 роки тому

    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 ua-cam.com/video/8y6akNTUt2Y/v-deo.html

  • @Maurilustrador
    @Maurilustrador 3 роки тому

    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 роки тому +1

      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.

  • @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

  • @JustinFraser314
    @JustinFraser314 9 місяців тому

    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  9 місяців тому +1

      I believe the only difference is the alpha channel now being separate ua-cam.com/video/azGMuP9ks8U/v-deo.html
      Everything else should work the same

  • @ayushjain1655
    @ayushjain1655 3 роки тому +1

    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 роки тому +1

      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
    @angat7564 6 місяців тому

    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.

  • @thefrenchdev965
    @thefrenchdev965 3 роки тому

    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 роки тому +1

      @@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.

  • @Maurilustrador
    @Maurilustrador 3 роки тому

    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 роки тому +1

      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.

  • @Dannyxv8
    @Dannyxv8 3 роки тому

    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?

  • @ayushjain1655
    @ayushjain1655 3 роки тому

    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 роки тому +1

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

  • @AnkitPatel04
    @AnkitPatel04 8 місяців тому

    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

  • @thewar4yourmind356
    @thewar4yourmind356 2 роки тому

    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 роки тому +1

      Enabling GPU instancing fixed it for me.

    • @lack_05
      @lack_05 Рік тому

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

  • @juliaalder2007
    @juliaalder2007 Місяць тому

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

  • @VIT3Z
    @VIT3Z 2 роки тому

    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?

  • @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.

  • @smirkinmerkin4997
    @smirkinmerkin4997 Рік тому

    Could this work for grass on a tilemap as well?

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  Рік тому +1

      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.

  • @FortbloxNET
    @FortbloxNET 2 роки тому

    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 :)

  • @redinternet9893
    @redinternet9893 2 роки тому

    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

  • @LePetit2
    @LePetit2 3 роки тому +1

    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 роки тому +1

      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?

  • @nanomantube
    @nanomantube 3 роки тому

    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 роки тому +1

      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.

  • @Jaypordy
    @Jaypordy 3 роки тому

    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.

  • @MasterofFire-sc3yn
    @MasterofFire-sc3yn 3 роки тому

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

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 роки тому +1

      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 роки тому +1

      ​@@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.

  • @Cash_Online
    @Cash_Online 3 роки тому

    can I use that with URP

  • @manolov4074
    @manolov4074 3 роки тому

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

    • @CodeMonkeyUnity
      @CodeMonkeyUnity  3 роки тому +1

      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!

  • @svetlanasygiainen5339
    @svetlanasygiainen5339 10 місяців тому

    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

  • @derpenz5376
    @derpenz5376 3 роки тому +1

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

    • @derpenz5376
      @derpenz5376 3 роки тому +1

      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 роки тому +1

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

    • @50Gameplay
      @50Gameplay 3 роки тому

      @@derpenz5376 same to me, have no solution

  • @DarkEspeon40K
    @DarkEspeon40K 3 роки тому

    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~

  • @georgehelms6332
    @georgehelms6332 3 роки тому

    Hi

  • @zakisellami8899
    @zakisellami8899 3 роки тому +1

    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 роки тому +1

      I've covered several character controllers previously, they all use a simple float to manage the moveSpeed ua-cam.com/video/Bf_5qIt9Gr8/v-deo.html

    • @zakisellami8899
      @zakisellami8899 3 роки тому

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

    • @rxn7
      @rxn7 3 роки тому +1

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

  • @nocultist7050
    @nocultist7050 3 роки тому

    Will you join Odysee?

  • @gower1973
    @gower1973 3 роки тому

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

  • @semithegamedeveloper6995
    @semithegamedeveloper6995 3 роки тому

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

  • @sagrgywejhxcvx
    @sagrgywejhxcvx Рік тому

    shaders are your worst side