Great tutorial, love the use of spring mechanics! For anyone wanting to add blur to the water shader, switch line 7 with: vec4 color = texture(SCREEN_TEXTURE, SCREEN_UV, blur_amount); (blur_amount would be a float variable, probably in the range 15)
@pixelipy7716
3 жыл бұрын
I'll be using that myself!!! HAHAHA thank you ! you're a lifesaver . Gotta study shaders a bit more
@wash99
3 жыл бұрын
Thanks mate
@paypercutts
3 жыл бұрын
Helpful! Thank you Ilay
@raipenta
Жыл бұрын
in godot 4.0, update function has changed to queue_redraw
@Deffrak
Жыл бұрын
In addition, to make the smooth_path_modified script to work I needed to change the variables a bit to be compatible with Godot 4: @export var spline_length = 8 @export var _smooth: bool: set = smooth @export var _straighten: bool: set = straighten @export var color: Color = Color(1,1,1,1)
@primevolcano
Жыл бұрын
@@Deffrak THANK YOU WE NEED TO GET THIS HIGHER
@Infirmi
Жыл бұрын
@@Deffrak you fucking hero. I was asking chat gpt and all sorts and it was useless. Thank you
@Nae_Ayy
10 ай бұрын
@@Deffrak Bro you saved my life I love you
@nobodyinparticular80
8 ай бұрын
You’re awesome man. Subbing.
@veryhungryprogrammer3620
2 жыл бұрын
For anyone who might run into a similar as me, I am making a pixel art game and my resolution is 192 x 108 so the sizes I need for this are much smaller. Everything worked fine until the "smooth border". After a while of messing around I ended up fixing it by changing the spine length of the water border to 10. Also have a look at GrayDwarf's comment as I had also corrected that. Other then that theres a couple differences between the script shown on screen and the script you copy and paste so look through those and double check everything you can see is the same.
@hyperventalated
Жыл бұрын
Thank you! I was running into a similar issue with the line looping, and this fixed it! Just to add onto this, the "Spline Length" property is on the Water_Border Path2D node.
@bingobangini
Жыл бұрын
@@hyperventalated But changing the spline length to 10 makes it less smooth, which is the whole point of this right haha. It looks like the line overshoots the point and then goes back to it or something..
@graydwarf22
3 жыл бұрын
Great tutorial! FYI: In v3.2.3 & v3.3.2, godot quietly rounds the spread value (0.0003) down to 0 when you change it in the UI. Looks like Pixelipy is using an unreleased build to get that precision level support in the UI. As a workaround, you can remove the export declaration and set the spread value in code. That will stick. Alternatively, you can adjust the spread value in the UI to 0.001 and that also works but you get a more aggressive spread.
@graydwarf22
3 жыл бұрын
and as I get a little further along, I see that Pixelipy's value ends up being 0 in the UI as well. :)
@ThisIsFez
11 ай бұрын
hey i'm trying to follow but it's not working at 10:26 right now. only the chosen index moves with the specified speed and not the rest of the springs. i feel like my i.update water function is not working. here is the code to the water_body: extends Node2D var k = 0.015 var d = 0.03 var spread = 0.0002 #spring array var springs = [] var passes = 8 #initializes the spring array and all the springs func _ready(): # loop through all the spring and make an array with all the springs for i in get_children(): springs.append(i) i.initialize() splash(2,8) func _physics_process(delta): #moves all the springs accordingly for i in springs: i.water_update(k, d) var left_deltas = [] var right_deltas = [] for i in range(springs.size()): left_deltas.append(0) right_deltas.append(0) pass for j in range (passes): # loops through each spring of the array for i in range(springs.size()): #adds velocity to the spring to the LEFT of the current spring if i > 0: left_deltas[i] = spread * (springs[i].height - springs[i- 1].height) springs[i-1].velocity += left_deltas[i] #adds velocity to the spring to the RIGHT of the current spring if i < springs.size() - 1: right_deltas[i] = spread * (springs[i].height - springs[i + 1].height) springs[i+1].velocity += right_deltas[i] # this fucntion adds a speed to a spring with this index func splash(index, speed): if index >=0 and index < springs.size(): springs[index].velocity += speed here is also the code of the water_springs extends Node2D #spring's current velocity var velocity = 0 #the force being applied to the spring var force = 0 #current height of the spring var height = 0 # natural position of the spring var target_height = 0 func water_update(spring_constant, dampening): # this function applies the hooke's law #update the height value based on the current position var height = position.y # the spring's current extension var x = height - target_height var loss = -dampening * velocity #hooke's law force = -spring_constant * x + loss #appy force to velocity velocity += force #make the spring move position.y += velocity func initialize(): height = position.y target_height = position.y velocity = 0
@graydwarf22
11 ай бұрын
@@ThisIsFezThere is a link to the project files that you can reference. If you're following along, you can compare side by side.
@jessejburton
3 жыл бұрын
Awesome tutorial, a really nice way of achieving this effect! I can see it's use in bridge dynamics as well, say for a wooden bridge as a character walks across it. Can't wait for more! :)
@pixelipy7716
3 жыл бұрын
not just that!! It can also be used as mud, lava, heck, even a pudding surface! you name it!!! I'm glad you like it and iI hope you can use it in some project of yours :D
@glimpsygames2734
Жыл бұрын
I modified your codes to C# language in Unity, haven't found any youtube shows how to program water. Thank you so much.You're Golden. If anyone wants my C# Codes, tell me in comment.
@DGdevv
Ай бұрын
I really loved your script logic, it will help me a lot.
@hyperventalated
Жыл бұрын
VERY IMPORTANT: I figured out why the flicker (mentioned at 25:00) is happening and how to fix it. How to fix: Go to the Water_Border script (the one you got from the description). Go to the _get_point(i) function, and delete the "-1" after point count so that it reads i = wrapi(i, 0, point_count). Now you can set the Spline Length to whatever you want (although if you do it too too high, the line will start looping on itself on every point). This might not be necessary, but I would also recommend changing the for loop under the smooth function from: for i in point_count: to for i in range(1,point_count-1): so that it doesnt curve the end points strangely. Why: As shown in the video, the water creates it's body by taking the baked curve points and creating a polygon out of them. When the script in the description does it's smooth(true) fuction, it curves the line from each point using the points before it and after it. When it finds these two points, it uses a wrapi() built in function to basically wrap the points back around (so if it tries to find a point out of bounds it instead wraps back around and starts from the beginning of the list of points). The issue is that the implementation of wrapi() in this script wraps 1 point too soon, so when the second to last point tries to find which direction it should curve the line, it finds the direction between the point before it and the very first point in the line (instead of the last point). This causes the line to make a loop because it's trying to curve backwards, and creating a loop in a Polygon2D (the body) can cause it to invert on itself and disappear, causing the flicker.
@bingobangini
Жыл бұрын
Ah thanks a lot man :). This smoothing script was too complicated for me to understand without explanation so I couldn't figure out what caused this.
@AleksandarPopovic
3 жыл бұрын
The video and tutorial is very high quality, you blew my mind i'm into programming but this is very, very, phenomenal, you need to make an addon of this for Godot and put in Godot official templetes.....and subb from me😉, keep going and good luck with your projects!
@pixelipy7716
3 жыл бұрын
That's actually a really good idea! I will look into how to make addons for godot and add it some time in the future!!
@Dines646
2 жыл бұрын
what happend it has been 9 months?? loved this series really got me inspired :(
@undergroundalienstudios56
3 жыл бұрын
Very useful. Bookmarked for later.
@paypercutts
3 жыл бұрын
don't forget! =P
@pixelipy7716
3 жыл бұрын
HAHAHA I'm sure you'll like the approach. This system is very useful actually to make all sorts of things, such as ropes, lava, mud, or pudding toppings
@riisezz0
2 ай бұрын
This is SO well explained. Thank you!
@martlepanen771
3 жыл бұрын
Hope you will publish more tutorials or devlogs! Best Godot tutorials on youtube!
@pixelipy7716
3 жыл бұрын
I will!! I had to take a break for a while, but I'm getting back with full strenght!!
@hypegamer347
3 жыл бұрын
Really enjoyed the tutorial, subbing and liking. Also, your accent sounds Portuguese, did I got it right?
@kerstenbr
3 жыл бұрын
In the channel description he says he is Brazilian, so yeah, you got it right Vai brasil!
@pixelipy7716
3 жыл бұрын
HAHAHAHA VAI BRASIL!
@pixelipy7716
3 жыл бұрын
YEAH you got it right! I must say making youtube tutorials is a great way to improve my english :DD
@edyteixeira3551
2 жыл бұрын
@@pixelipy7716 KKKKKKK NEM FODENDO EU SOU TEU FÃ
@alexrocha2444
2 жыл бұрын
@@pixelipy7716 Bem que eu suspeitava
@Sl1mb
20 күн бұрын
3 years since this video was published. So much potential and OP just vanished. Anyways - such a usefull tutorial!
@DeepDiveDevelop
Ай бұрын
fantastic tutorial! Thanks for uploading, you made it very easy to understand
@gamingwithsamurai6752
3 жыл бұрын
Wow nice job bro. These tutorials really help me 👍
@pixelipy7716
3 жыл бұрын
Thank you! I'm glad it is! more tutorials to come!
@ShazyShaze
3 жыл бұрын
Very nice tutorial! This is gonna be critical in one of my projects, thanks for sharing
@pixelipy7716
3 жыл бұрын
OH that's very nice to hear. Yeah, lot's of people want water of some other liquids in their games but don't know how. I'm glad to be helping :D
@gradybean5747
3 жыл бұрын
Pretty cool! Can't wait for the next tutorial!
@paypercutts
3 жыл бұрын
Yeah he's done a great job
@pixelipy7716
3 жыл бұрын
It's coming soon i hope! I had to take a break but now I'm back! I do have some tutorial ideas I think people will really enjoy, but I'm having trouble choosing. I think I'll just make all of them AUHAUHJAU
@pixelipy7716
3 жыл бұрын
Thank you! All the effort was sure worth it :D
@taisublack2599
3 жыл бұрын
Dude that’s amazing please keep do it tutorials!!
@pixelipy7716
3 жыл бұрын
I will!! And I will probably tackle on the transition shader tutorial soon as well!
@paypercutts
3 жыл бұрын
Well done on the success of your channel mate! over 1K is a coupla months is phenomenal
@pixelipy7716
3 жыл бұрын
Yeah!! It blows my mind every time I think about it. I unfortunately had to take a little break from game development (you know, adult stuff) but now I'm back and ready to get into programming once again! can't wait!
@themoeboy
3 жыл бұрын
I love the style of how you did this tutorial ! Thanks for this
@pixelipy7716
3 жыл бұрын
I was not sure about it!! HAHAHA But I'm glad people like this tutorial style. THank you for your feedback. More tutorials are coming for sure!
@marcosadrian65
3 жыл бұрын
Amazing tutorial man! And the water looks incredible!
@paypercutts
3 жыл бұрын
Yeah he's an inspirational content maker
@pixelipy7716
3 жыл бұрын
Thank you! Right!?? I'm thinking about some water shaders such as in New super Mario Bros,
@pixelipy7716
3 жыл бұрын
OH thank you! I'm glad you like the content. More videos are coming soon ! (I hope HAHAHA)
@marcosadrian65
3 жыл бұрын
@@pixelipy7716 that's will be super cool
@JuhoSprite
Жыл бұрын
Yoo the demo thing is actually so useful, people should make more of those thing whwre u can play around urself with some parameters, GMTK made the same thing with platform controls.
@davidjohnhamm
3 жыл бұрын
goat status. thanks for this
@pixelipy7716
3 жыл бұрын
Thank you! I actually had to search about goat status to see what you meant . I was like wait, is he calling me a goat UAHUAA thank you! I'm glad you like it. More videos to come!
@salahgamer1675
7 ай бұрын
Bro we need more tutorials like this one comeback 😂😂
@caitlynvernon2052
2 жыл бұрын
This tutorial is great, I'm trying to use to tutorials to learn how to do things, plus how they work. This video was great for that
@zelest
Жыл бұрын
Thank you! I've been searching for something like this for ages! It took a little persuasion, but I managed to get it working in Godot 4. Now I just have to see if I can't port it to C# XD
@Dinorigami
2 ай бұрын
can you share the code for godot 4?? i have been struggling for a while now but it still does not work...
@itzklausi_5168
3 жыл бұрын
Do more tutorials pls. Your Explaination is very clean dude
@naxsis_1Ki1game
3 ай бұрын
Wow i'm currently working a beast game for shake the 2d pixel art sector and there is a mechanic instead of water i need lava and think about how can i gonna make it in the game some sort of you help a lot. wish you continue to upload if you are not dead. Even you not continue to upload at least like this to know you are alive :)
@AlainPilon
2 жыл бұрын
I just discovered your channel, your content is awesome and super useful for someone who wants to make games. you havent posted in over about a year, I hope you didnt burned out and everything is fine and come back to YT whenever you feel ready, we will be waiting for you!
@XTRINO
2 жыл бұрын
Amazing tutorial and your game looks amazing aswell, i hope you make more great tutorials and continue to work on your game :)
@lucaivaldi4520
2 жыл бұрын
This tutorial is awesome! Can’t wait to see what comes with the next episode
@ariorick
2 жыл бұрын
So much work, insanely good
@LuisCassih
3 жыл бұрын
Really great tutorial, keep going! :)
@pixelipy7716
3 жыл бұрын
THank you! More tutorials are coming!
@redcubegamedev3860
3 жыл бұрын
Love this tutorial. Looking forward to watching the new tutorials. Keep up your create work you just earned yourself a sub.
@pixelipy7716
3 жыл бұрын
thank you for your support! More tutorials are to come, soon I hope :D
@NgaeGameStudio
3 жыл бұрын
Nice job 👍 godot engine user is getting bigger and youtube tutorial is more and more, love it ❤️
@gaminggamma2875
3 жыл бұрын
Nice Video, got it recommended rn
@pixelipy7716
3 жыл бұрын
thank you! This water was something lots of people asked me about . I'm glad I made this
@jorgeaugusto30
2 жыл бұрын
Man, I just loved your video. You explain so well and the video is so well edited.
@letraestoica
2 жыл бұрын
man, you saved my life thanks so much for this tutorial I just subscribed
@nestoreon3353
3 жыл бұрын
I love this! thank you, I learned a lot :D
@pixelipy7716
3 жыл бұрын
THank you!! I'm glad you like it. I'm really happy people are able to learn from me
@lksxxtodin5292
11 ай бұрын
This tutorial is amazing!! I loved your voice
@robko5711
3 жыл бұрын
Thanks man I've tried to solved this problem on my own. lost my mind hahah. You saved me days!
@westenfry
Жыл бұрын
Really great tutorial! I was trying it in Godot 4 and managed to get as far as the rock collision by checking the changes between versions until I started encountering issues with the extents and connections. Hoping at some point you might be able to do an updated version for Godot4 as this is one of the best tutorials I've followed so far and would love to be able to achieve the last few steps.
@primevolcano
Жыл бұрын
I've got this error Invalid type in function 'connect' in base 'Node2D ()'. Cannot convert argument 2 from int to Callable. Do you know how to solve it its when connecting the signal
@boshty
8 ай бұрын
I got around the extents stuff with one line in Godot 4. collision.shape.size = Vector2(value, collision.shape.size.y)
@kaysmith7468
7 ай бұрын
Answering your original query @westenfry, it looks like they changed the connect() argument for Godot 4. The below worked fine for me: w.connect("splash", splash)
@tomc5302
6 ай бұрын
Thanks, that saved a lot of headache! @@kaysmith7468
@baumwolle2548
Жыл бұрын
great effort on the animations, gj
@nobodyinparticular80
8 ай бұрын
This is really really cool
@tinyBigGAMES
3 жыл бұрын
Good stuff, many thanks.
@pixelipy7716
3 жыл бұрын
HAHAH thank you for your support, glad you liked it !
@DanielRead89
2 жыл бұрын
Great tutorial! Thank you very much!
@coyotewld
Жыл бұрын
Thank you! Great tutorial
@UliTroyo
7 ай бұрын
Great tutorial!
@spenzenpoek
2 жыл бұрын
Very nice! Thank you! 👏
@BluePhoenixGames1
4 ай бұрын
great tutorial!
@itsME-dc4vm
3 жыл бұрын
wooow nice ;D
@pixelipy7716
3 жыл бұрын
Thank you!
@CantMakeGames
4 ай бұрын
Thank you so much.
@CallousCoder
10 ай бұрын
You a actually could do the waves in the shader as well. It’s just adding two sines and reducing the strength from the point where you impact it. If you make that location 0.0,0.0 for the uv you can just move your logic into the fragment and do it all on the GPU.
@hunterentrican5704
3 ай бұрын
So youre saying everything in this video could be done using shaders???
@CallousCoder
3 ай бұрын
@@hunterentrican5704 the waves. So the whole water thing can be done solely in a shader yes.
@hunterentrican5704
3 ай бұрын
@@CallousCoder wooow. I have barely ever worked with shaders, but that seems way easier and probably better optimized. I will definitely be trying to figure that out in the future 😅 Thanks for the info drop 6 months ago!
@vedrane0
3 жыл бұрын
I just noticed that the character looks a bit like Turnip Boy from Turnip Boy Commits Tax Evasion. Nice video! Looking forward to more.
@pickledcockroach8157
2 жыл бұрын
Great tutorial, thanks a lot!! :D
@guilhermekaercher1624
3 жыл бұрын
Boa irmão, great tutorial! Thanks a lot! Cheers!
@Limited_Film_Works_
Жыл бұрын
Good video, I learned a lot.
@danieldarko6495
3 жыл бұрын
I just subbed and liked too. This is awesome
@pixelipy7716
3 жыл бұрын
thank you!! I'm really happy to see people implement this system into their games :D
@carlitos5336
2 жыл бұрын
Thank you so much!!
@99JasonKim
3 жыл бұрын
amazing
@pixelipy7716
3 жыл бұрын
Thanks ! :)))))
@herehere3139
11 ай бұрын
Wow man great work, Thank you for your work. I'm definitely gonna check all your other videos out as well. I just found this as I'm still pretty new to Godot but was wondering what options there are for making 2d water exactly like this. Thanks again!
@junejuly532
3 жыл бұрын
Awesome
@pixelipy7716
3 жыл бұрын
Thanks!
@felipefacundes1
3 ай бұрын
Thanks
@sebitcr
2 жыл бұрын
Welp, this was interesting... Great tutorial, however... If you don't want to use the "motion" (21:55) variable, you can replace it with the "linear_velocity" property, but this needs adjustments to the motion factor (0.02 works great)
@mightymochigames
3 жыл бұрын
Super cool! Looks like this could be partially created with the built joints instead of manually coding.
@pixelipy7716
3 жыл бұрын
It does! I could not manage to make it using joints though, but I will certainly try it some time
@csaratakij6339
3 жыл бұрын
Nice~
@pixelipy7716
3 жыл бұрын
Thanks !
@trip7141
Жыл бұрын
I'm not sure if anyone will ever read this, but I cannot get the export variable for depth to work on my own or in the project I downloaded. If you change it in the script it works fine, but the export refuses to work. I've been pulling my hair out trying to figure out what the deal with it is. Edit: I tinkered with it a little more. In case someone else has this problem, I had to change the "bottom" variable in the Water_Body script to an onready variable. That seems to have fixed it. I have no idea why it worked though, and it may not be the best approach but it worked for me.
@vonbluhm7201
Жыл бұрын
You definitely weren't alone here. Thanks for the help!
@jonathanperreault4503
3 жыл бұрын
it would be amazing use this with smart shape
@pixelipy7716
3 жыл бұрын
I TRIED BUT I DID NOT MANAGE TO MAKE IT!!! It would look awesome!! to be able to change the water borders, texture, and so forth.
@arifkasim3241
3 жыл бұрын
Very nice, now use the same technique to make a video on ropes and rope movement when a player jumps on it.
@zbkl391
Жыл бұрын
Excellent tutorial! I've been working on a 2D pixel platformer game recently. Is there a more suitable water solution specifically for 2D pixel games?
@Max_prez555
11 ай бұрын
Hey, just wanted to ask: you figured it out yet?
@EverythingPermitted
2 жыл бұрын
Thank you for this amazing tutorial! I was wondering if you could help even more? I want the water to slighlty and constantly move on their own without any outside interference. How would I go about doing that? And is there a way to make this water look like pixel-art?
@codingwithellie
4 ай бұрын
Please do more things.
@panociagasta
3 жыл бұрын
Coool
@pixelipy7716
3 жыл бұрын
:DDD Thanks :)
@PokettoMusic
3 жыл бұрын
based
@WeirdGoat
Жыл бұрын
Great job! Could you please make a video to tell us how to make a water pit in a Top-Down game, it shows waves and reflection when a character walk on it? Thanks in advance!
@johnrussell6971
2 жыл бұрын
*Note:* This comment is for my personal note 6:03 - Without loss 6:38 - With loss
@keaultra
23 күн бұрын
Maybe I'm missing something. Everything works but there's no way to see what this looks like in the editor until you load debug? I love this but I can't utilize it well if I cant see the size. Also, how did you get the height of the water to be customized ? for me it's really tall NVM figured it all out. I can adjust as needed while in debug. as for the shape and height of the water I'm using another polygon 2d to create a shape to fit the water in, then adding a body water as a child of it then clipping the contents as clip only to remove the polygon from view. thanks for this tutorial!
@SaturnoEdu
Ай бұрын
in godot 4 i'm having this issue: water_border.width = border_thickness Invalid assignment of property or key 'width' with value of type 'float' on a base object of type 'Path2D (SmoothPath)'.
@Zurpanik
10 ай бұрын
Newton is very much sad! Can't believe Hooke was actually useful here!
@user-he1hs6qk3h
11 ай бұрын
Great, can you come up with a tutorial in C#
@MikeMcRoberts
3 ай бұрын
Why did these videos suddenly stop 2 years ago?
@harmony_hunnie
3 жыл бұрын
starting an array with 1 for the example 0=
@pixelipy7716
3 жыл бұрын
I didn't get it HAHAHA. We only had to start the array with one because we were checking the left neighboors of this array element. If we're looping through array[0], we would be checking array[-1] which godot does not like in the slightest
@olwlout8308
2 жыл бұрын
Cara você me ajudou muito brigado,tenha um ótimo dia e vai fundo eu sei que tu tem futuro
@sosasees
3 жыл бұрын
Oh Boy, this is Complicated! I hope I can learn to understand this if I actually need to use the water shader.
@pixelipy7716
3 жыл бұрын
Yeah, it did take some time to figure out how it works, but as long as you understand the concept, you're fine!
@kettle4805
2 жыл бұрын
Great tutorial, but I have an issue. It seems that I can't actually change the depth in the export, and I need to actually change it in the script itself. Any clue what could be happening here?
@vonbluhm7201
Жыл бұрын
Other folks had mentioned here that you should place the @onready declaration after the bottom variable. I know you may have solved this problem by the time you read this, but I also hope it will help out a random stranger like me.
@xgozulx
2 жыл бұрын
I implemented this into a proyect im working on and it has a very weird bug. It works perfectly at first, but if you leave the water still without touching it for like a minute or so, sudenly the game lags like crazy. but if you go back to where the water is and jump in it it goes back to normal
@antonioedmilson1810
3 жыл бұрын
Incrível!
@pixelipy7716
3 жыл бұрын
Valeu amigo! :D:DDD
@cavemanpl5166
2 жыл бұрын
Hi All, I have downloaded complete project. How it is possible that spring_number variable is set to six in declaration and also in inspector but when I switch on visibility of sprite in Water_Spring scene I can clearly see that is more springs (than six) when run project?
@mistouluf8518
5 ай бұрын
Hello I have a problem, on version 4.2.1 of godot, it does not work correctly, get_extend and set_extend must be replaced by set_width and get_width but another error in func new_border() water_body.update() does not exist , it is displayed but does not animate...
@91tj
3 ай бұрын
Same here... I hope someone can help with this issue.
@ThisIsFez
11 ай бұрын
hey i'm trying to follow but it's not working at 10:26 right now. only the chosen index moves with the specified speed and not the rest of the springs. i feel like my i.update water function is not working. here is the code to the water_body: extends Node2D var k = 0.015 var d = 0.03 var spread = 0.0002 #spring array var springs = [] var passes = 8 #initializes the spring array and all the springs func _ready(): # loop through all the spring and make an array with all the springs for i in get_children(): springs.append(i) i.initialize() splash(2,8) func _physics_process(delta): #moves all the springs accordingly for i in springs: i.water_update(k, d) var left_deltas = [] var right_deltas = [] for i in range(springs.size()): left_deltas.append(0) right_deltas.append(0) pass for j in range (passes): # loops through each spring of the array for i in range(springs.size()): #adds velocity to the spring to the LEFT of the current spring if i > 0: left_deltas[i] = spread * (springs[i].height - springs[i- 1].height) springs[i-1].velocity += left_deltas[i] #adds velocity to the spring to the RIGHT of the current spring if i < springs.size() - 1: right_deltas[i] = spread * (springs[i].height - springs[i + 1].height) springs[i+1].velocity += right_deltas[i] # this fucntion adds a speed to a spring with this index func splash(index, speed): if index >=0 and index < springs.size(): springs[index].velocity += speed here is also the code of the water_springs extends Node2D #spring's current velocity var velocity = 0 #the force being applied to the spring var force = 0 #current height of the spring var height = 0 # natural position of the spring var target_height = 0 func water_update(spring_constant, dampening): # this function applies the hooke's law #update the height value based on the current position var height = position.y # the spring's current extension var x = height - target_height var loss = -dampening * velocity #hooke's law force = -spring_constant * x + loss #appy force to velocity velocity += force #make the spring move position.y += velocity func initialize(): height = position.y target_height = position.y velocity = 0
@abodaqil7123
8 ай бұрын
I tried to make it but it didn't work. Can I take it?😢
@cugames1676
2 жыл бұрын
Do you have the source code? i dont use Godot but would like to try this in Unity/c#
@nganga765
2 жыл бұрын
My polygon does not align with the springs like your do my springs a position lower into the polygon rather than on top please help
@HarbingerSh
2 жыл бұрын
do it in pygame please
@VampireDGames
Жыл бұрын
MLK vc é pika demais, certeza que é BR
@domeen0gt895
5 ай бұрын
Is anyone aware on how to make the player and other objects float on water?
@hey-pnsuena9673
3 жыл бұрын
Hello Bro , i LOVE all your,s videos , en fin no hablo inglés i speak spanish , quiero saber cómo se hacen los foreground , nadie lo enseña en Godot
@amandalaznicka3330
9 ай бұрын
Hello, have you ever made available the source code? Thank you so much for this tutorial ~
Пікірлер: 199