This all tutorial series by you are as good as paid tutorial out there! You deserve more views and subscribers! Thank you for your teaching and hope to see what's coming next. Happy New Year!!
This was the best tutorial I have come across! Prior to this I was messing about with Kinematic Body 2D trying to get my click+drag movement to work and it was a nightmare, this video solved all my issues in no time. Thanks a lot!
Very helpful! As always, great looking out for everyone. This has been a great year for learning Godot and I can't wait to see what is to come. Thanks a ton and have a Happy safe Holiday!
When talking about the custom integrator the documentation indicated collision response is not overridden. How could one apply a static friction or minimum collision force for movement requirement?
How would I change the position of a rigid body 2D manually from a different object's script? I don't have access to the objects physics state directly
Hi. My game needs to involve a directly controlled player character influencing the physics of all enemies, and likewise the enemies to the character. Are there gonna be any drawbacks to this endeavour from the outset? What's gonna be limiting?
You can either go into Project settings and set the default gravity vector to (0, 0), which will completely turn off gravity, or set the ship's gravity scale to 0, which will make the ship specifically immune to gravity.
Hello, kidscancode, I have a problem, I was reading the documentation on the kinematics page in this adress: docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html and I've followed everything in the same way, but when I run the scene the player just falls and walks very very very slow, I've tried with your videos as well but the same happens. The player and the gravity are very slow. I don't if it's a bug of the new version (rc3)
I took a look and the error is in the document. "move_and_slde()" handles delta internally, so you shouldn't multiply velocity by delta. This is documented in the KinematicBody2D docs.
I'm not sure what you mean. We set up the thrust to always point in the direction the ship is facing. Do you only want it to go upward no matter which way the ship faces?
No, in the function of this tutorial's script you wrote "if Input.is_action_pressed("ui_up"): thrust = Vector2(engine_thrust, 0)", and you changed a rotation degree of the ship's sprite to 90, so it will match direction of the ship. You didn't pointed ship up, you rotated the texture to right. I wonder, why this func points ship exactly in the right direction at game's start? Not in the left, down, etc. Except of this right-pointing, this script could fit well for some lander-genre game. I was puzzled by this, but already solved the problem, just rotated ship's RigidBody to -90.
In Godot's coordinate system, zero degrees points to the right (along the x axis). So the rigid body is already pointing in that direction when its rotation is 0. However, to make the texture match that, we rotate the texture to match. Glad you found a solution to your problem.
Hi, I've copied the code from the written version for the thrust and rotation section and the rotation does not work for me. The thrust is fine. I wonder if you can offer any advice on where to look for a problem with the rotation. As I mention, I copied and pasted the code directly from the written version. Thanks for a great tutorial.
Copy-and-paste from the web can sometimes lose formatting information, so you might need to check whether things are in the right place, especially when it comes to indentation. Other than that, I can't really speculate - I don't have enough information. Maybe try putting a print() statement after the keypress detection and see if it prints when you press the left/right arrows.
I've always wondered: Why does Godot (and Unity as well, for that matter) allow rigid bodies and collision shapes to be scaled if it's never a good idea to scale them?
One question. I have downloaded the suggested Art Pack & imported the sprite sheets. Is there a way to slice the part of the sprite sheet I want? PS - Apologies for the noobish question.
Sure. You drag the sheet onto the texture field of the Sprite. Then you check the box marked "Region" to On. Now you can click on the "Texture Region" panel at the bottom of the screen to select the region of the sheet you want to use.
When including a projectile for shooting down rigid bodies, but easily moved by code, it's best to use kinetic, right? i bring this up, because I think many game makers would want to know this when they want a gun or cannon which will realistically knock down block walls, etc. I made a shooter using a node 'projectile_container' in the main scene which created a new kinetic body projectile whenever the previous one has been shot. I added gravitation and movement and it works fairly well so far, but Any input would be appreciated!
You can use just about any type - it depends what you're going for. Often for bullets I prefer to just use Area2D since they're going to just detect the hit and disappear. If you want gravity/bouncing/etc, a rigid body might work better for you. In gamedev there are often multiple solutions to a problem.
Hey thanks so much. I originally tried using rigid body cannon shells, but i couldn't figure out how to get them to go to a particular location ( where ever the tank happened to be located) when they were spawned. I'd prefer rigid body since their gravity and bouncing would look more realistic when bouncing off buildings or blocks. There is no set_pos function for rigid body, right? So how would you spawn a child at a particular location the moment the player presses the space bar to fire?
Well, had I watched the video till the end, the answer to my question was already in the video, namely which is using get_transform and set_transform for rigid body
7 років тому
You show in the video a new way to do a asteroid clone. Should we use this approche or use a Area2D like you did in the asteroid tutorial ?
You can - it's got pros and cons. If it's working fine, it's not really worth switching. I did find it worked better to use Rigidbody2D for the asteroids themselves.
Thank you so much for all of your programming help. You are excellent at explaining things, and have been a great help for me learning to make stuff. thanks :)
Hmmm, this does not work properly at all in ver 3.2.1. The screensize variable needs screensize = Vector2() otherwise it will give a get null error. When applying the func _integrate_forces the ship always remains half offscreen at the top left and when applying thrust, it moves very slow and then tries to move backwards, very strange. It works fine (except for off-screen teleport). If it works for you, would you mind adding the code that works? Love your tutorials by the way, One of the best so far in the Godot World.
Hmmm, looks like the screensize = get_viewport().get_visible_rect().size was the issue. When I pit the vectors in manually then there is no issue and it works
So i'm currently making a game (Wich is possibly due to your tutorials, thanks!), but in Godot 3.0 they removed the opacity option in sprites. And i want a sprite to slowly fade in. How do i do this now? I've looked all over the internet but nothing about it in Godot 3.0
In 3.0, opacity was removed because it's redundant with the "modulate" property's alpha value. To change a sprite's opacity to 50% for example, you would do $Sprite.modulate.a = 0.5
Follow the docs: - Sprite inherits CanvasItem (docs.godotengine.org/en/latest/classes/class_canvasitem.html) - The CanvasItem.modulate property is of type Color (docs.godotengine.org/en/latest/classes/class_color.html) - Color has properties r, g, b, and a (alpha) In RGBA color, the "A" represents the transparency value from 0 (fully transparent) to 1 (fully opaque)
This has been super helpful, thank you! Playing around with the rigid bodies is going to be fun. But there's a thing I'd like to know. So I'm making a 3D platformer with attack combos. It's fine that my character can push around a box or a ball by simply colliding with it, but how do I apply a directional force to the physics object when I punch or kick the object?
Hey, would you please consider making further python tutorials perhaps on the basics and even more pygame tutorials? I would really love more content on python. Something specifically that I would like to learn more about is classes in python if that would be possible. Your videos are honestly the best resource I have found on UA-cam, and the structure of your videos really suit my style of learning, and I would really love more content on python to further extend my knowledge :) Thank you!! :D
I'm not against it, but right now I'm very busy with Godot-related material because of the 3.0 release. After that, we'll have to see what happens. In general, I'm sort of frustrated with the state of Pygame. I love using it from way back, but it's so out-of-date and showing its age, especially compared to frameworks like Love2D. In the meantime, if you're looking for more about the basics, this is my favorite Python book: openbookproject.net/thinkcs/python/english3e/ and includes a good chapter on objects and classes.
What an amazing resource, thank you soo much for showing me this. I am currently completing your platformer pygame series and I also want to end up completing the tile based game series. I really enjoy completing projects which is why I like your pygame series. Do you recommend for me to continue applying my basics with projects and develop with them or go back to the theory side of things (online courses, books, etc I also really enjoy object orientated programming, which is probably why I really enjoy game development, however I understand that C++ or Java may be better for stuff like game dev. (correct me if I'm wrong!) Should I continue with python or venture into another language such as C++ or Java if I want to continue game development. I've been looking around at Unity, (which uses C#?) as well. (I guess I could learn both as well!) Right now I'm 15 and coding is a passion for me, and my ultimate goal is to study and pursue a career in software engineering. I really want to make sure that I know what I should (and shouldn't) be doing. I think I'm coming off as a little paranoid right now but I hope that's okay :)
So, the main difference between _physics_process and _integrate_forces is that the latter allows non physics properties modifications to the RigidBody2D. Am I correct? Does it come with drawbacks? Why not use _integrate_forces by default for all physics management then? The documentation is a nightmare to understand anything and I'm very happy that people like you are making tutorials about Godot. I don't know what superpowers you have to manage to make sense of the documentation. This is beyond my understanding...
_integrate_forces is specifically for rigid bodies, when you need to do something custom to the physics. _physics_process is for when you need code on any node that runs synchronized to the physics timestep. As for the documentation, are you talking about the class reference? Because that's intended for developers - it's a reference, to give you the information you need when you know what you're doing, but just need to look up a function or definition. I'm just guessing here, but if you're new to programming, that's why it seems not to make sense to you (yet). Educational documentation is very different, and can be found under the "Getting Started" and "Tutorials" sections.
@@Kidscancode Well, actually I was specifically talking about the Getting started and Tutorials sections. The API documentation is really good but to get the most of it, one must understand how the general engine works. And that's exactly what the educational part is lacking: understandable content. It explains the inner workings of each part of the engine without any explanation nor examples on how to use it. It's more a design choices list than a helpful "getting started" part. Over everything else, I want to learn how to use the engine then have some explanations on why use that technique rather than another (just like this video does). I cannot make sense of anything in the documentation. Each time I read a section, it's too technical and useless. It's not beginner friendly. Even the example projet is only a follow through tutorial without clear explanations of techniques that I can transfer to a personal project. I do understand that a first project can be a features show to get an overall image of the engine but it should be followed by a thorough analysis of the project done in order to understand it fully. That's why I really enjoyed your Godot 101 series: it's really detailed and helped me get a solid grasp of the engine. Before that, I tried many times to make sense of the documentation (nearly two years now) and couldn't even make a simple Pong. With only the first five videos of your 101 series, I could at last do it. I learned some small but really useful tips (like hovering over a property in the Inspector to know the exact name of the property in GDscript) from many sources (mostly youtube channels and discord servers) but none come from the official documentation.
Love the tutorial. Do you have any suggestions to change the physics behaviour? I need an object to basically behave like a kinematic object when under direct control of the user, and as a rigid body when the user releases control
That's a good question. My first thought would be to toggle the mode property from MODE_RIGID to MODE_KINEMATIC. The tricky part will be in handling the transition smoothly. Sounds like a fun project to tinker with.
I wish I'd got this video before I spent a week trying to change an object's physics inside _physics_process(). Docs and tutorials should point users to _integrate_forces() by default.
Anyone know how to increase the min and max speed of the creeps as time goes on so that the challenge gradually increases. This is my failed attempt, please don't judge me too harshly ;) : func speed_increase() -> void: if score > 20: $Mob/MAX_SPEED = $Mob/MAX_SPEED + 100 and $Mob/MIN_SPEED = $Mob/MIN_SPEED + 10
Just do it when you spawn the mobs. The main scene sets the speed of them when they are instanced. Add a time-related value to that. Why is this question posted on the RigidBody video?
@@Kidscancode Thanks a lot I came to that conclusion, however, I am quite sure the code could be neater: mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED, mob.MAX_SPEED), 0).rotated(direction)) if score > 15: mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+100, mob.MAX_SPEED+200), 0).rotated(direction)) elif score > 30: mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+200, mob.MAX_SPEED+400), 0).rotated(direction)) elif score > 45: mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+300, mob.MAX_SPEED+600), 0).rotated(direction)) elif score > 60: mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+300, mob.MAX_SPEED+600), 100).rotated(direction)) elif score > 75: mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+500, mob.MAX_SPEED+1000), 200).rotated(direction)) elif score > 90: mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+600, mob.MAX_SPEED+1200), 300).rotated(direction)) elif score > 105: mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+700, mob.MAX_SPEED+1400), 400).rotated(direction)) else: null Thank you so much for all your lessons :)
7 років тому
thanks for this tutorial. I just finished the asteroid tutorial (15 parts). Did you put the code into github for this video ?
Hmm, I didn't because it was such a small project. I can put it up as soon as I get a chance.
7 років тому
I did copy the code manually it's not the long, but for someone that just want to play with it or search code in github it's fun to have code . thanks again for the video. I had a good time watching them all week
I really just made a game about a rocket dodging orbiting and falling asteroids, using just kinematic bodies... How the hell did I forget to use rigid bodies hahaha?! Guess it's just me being a control-freak.
This all tutorial series by you are as good as paid tutorial out there! You deserve more views and subscribers! Thank you for your teaching and hope to see what's coming next. Happy New Year!!
I just subscribed ^.^ Your statement was spot on, dude is a beast!
Yes absolutely! Tell to all of ur relatives to subscribe him! Fantastic premium content to learn on youtube!
This was the best tutorial I have come across! Prior to this I was messing about with Kinematic Body 2D trying to get my click+drag movement to work and it was a nightmare, this video solved all my issues in no time. Thanks a lot!
6 years still this video can help me alot.. Thanks you for help my game can survive, otherwise my game would end up in garbage..
This is by far the best explanation of RigidBody2D I've found. Makes so much more sense now. I'm hoping enough of this translates to Godot 4. Thanks!
There are some minor changes in the syntax, but the concepts remain the same.
Very helpful! As always, great looking out for everyone. This has been a great year for learning Godot and I can't wait to see what is to come. Thanks a ton and have a Happy safe Holiday!
Thanks! Happy New Year!
For whatever reason, I feel your code is super clean
5:36
...balls...
... and that concludes my TED talk.
These tutorials are by far the best I've seen. So easy to follow and understand.
Could you update this, please? set_applied_torque don't exist any more.
Thank you, I found this quite informative. This is the basic sort of stuff that beginners like me really need.
When talking about the custom integrator the documentation indicated collision response is not overridden. How could one apply a static friction or minimum collision force for movement requirement?
one question, i really liked the click ball one, but how would i do it if i wanted to be able to click (only) when the ball is still and not moving?
Happy new year to you🔝
i have a doubt how can i use a ragdoll using it pls reply fast
Thank you very much for this. Your way of explaining is fantastic. Clear, really helpful and calm - I love it. :)
How would I change the position of a rigid body 2D manually from a different object's script? I don't have access to the objects physics state directly
Send a signal to the rigid body with the new position, and let the rigid body set its position in _integrate_forces()
Hi. My game needs to involve a directly controlled player character influencing the physics of all enemies, and likewise the enemies to the character.
Are there gonna be any drawbacks to this endeavour from the outset? What's gonna be limiting?
That's impossible to say. Just start making it and see what happens. If any bottlenecks appear, that's when you should worry about addressing them.
@@Kidscancode thanks a lot
@@Kidscancode just occurred to me that might have come off as sarcastic. To clarify thanks for the help lol
Is the ship supposed to have gravity? Because whenever I start the scene, the ship starts going down the screen.
You can either go into Project settings and set the default gravity vector to (0, 0), which will completely turn off gravity, or set the ship's gravity scale to 0, which will make the ship specifically immune to gravity.
@@ZenoDovahkiin oh ok
Is there a way to make the click and drag only work if you are clicking on the ball ?
Of course, you have to check how far you've moved the mouse versus the size of the ball.
@@Kidscancode Could you explain this in more detail?
Great tut! Keep up the great work. Very helpful.
Is there any way to change the gravity/friction axis? in case I'm doing a top-down game and needs the physics
"Default Gravity Vector" in Project Settings -> Physics -> 2D. Note you can also use Area2D to override global physics properties as well.
Hello, kidscancode, I have a problem, I was reading the documentation on the kinematics page in this adress: docs.godotengine.org/en/latest/tutorials/physics/kinematic_character_2d.html and I've followed everything in the same way, but when I run the scene the player just falls and walks very very very slow, I've tried with your videos as well but the same happens. The player and the gravity are very slow. I don't if it's a bug of the new version (rc3)
I took a look and the error is in the document. "move_and_slde()" handles delta internally, so you shouldn't multiply velocity by delta. This is documented in the KinematicBody2D docs.
Thank you, it works now
I noticed that engine_thrust always moving ship only in the right direction. Can i move ship in the vertical direction by code?
I'm not sure what you mean. We set up the thrust to always point in the direction the ship is facing. Do you only want it to go upward no matter which way the ship faces?
No, in the function of this tutorial's script you wrote "if Input.is_action_pressed("ui_up"): thrust = Vector2(engine_thrust, 0)", and you changed a rotation degree of the ship's sprite to 90, so it will match direction of the ship. You didn't pointed ship up, you rotated the texture to right. I wonder, why this func points ship exactly in the right direction at game's start? Not in the left, down, etc. Except of this right-pointing, this script could fit well for some lander-genre game. I was puzzled by this, but already solved the problem, just rotated ship's RigidBody to -90.
In Godot's coordinate system, zero degrees points to the right (along the x axis). So the rigid body is already pointing in that direction when its rotation is 0. However, to make the texture match that, we rotate the texture to match. Glad you found a solution to your problem.
I wish i had a teacher like you at school, love you videos, thank's
Hi, I've copied the code from the written version for the thrust and rotation section and the rotation does not work for me. The thrust is fine. I wonder if you can offer any advice on where to look for a problem with the rotation. As I mention, I copied and pasted the code directly from the written version. Thanks for a great tutorial.
Copy-and-paste from the web can sometimes lose formatting information, so you might need to check whether things are in the right place, especially when it comes to indentation. Other than that, I can't really speculate - I don't have enough information. Maybe try putting a print() statement after the keypress detection and see if it prints when you press the left/right arrows.
This is old, but I had the same issue. Found out that I had the RigidBody2D mode set to `Character` when it should have been set to `Rigid`.
I've always wondered: Why does Godot (and Unity as well, for that matter) allow rigid bodies and collision shapes to be scaled if it's never a good idea to scale them?
There has to be a reason, but i don't know it either...
3.1 removed that ability
One question. I have downloaded the suggested Art Pack & imported the sprite sheets. Is there a way to slice the part of the sprite sheet I want?
PS - Apologies for the noobish question.
Sure. You drag the sheet onto the texture field of the Sprite. Then you check the box marked "Region" to On. Now you can click on the "Texture Region" panel at the bottom of the screen to select the region of the sheet you want to use.
Also there is now an auto slicing option in the "Texture Region" panel from the Snap Mode. Once done simply click on the slice you want.
When including a projectile for shooting down rigid bodies, but easily moved by code, it's best to use kinetic, right? i bring this up, because I think many game makers would want to know this when they want a gun or cannon which will realistically knock down block walls, etc.
I made a shooter using a node 'projectile_container' in the main scene which created a new kinetic body projectile whenever the previous one has been shot. I added gravitation and movement and it works fairly well so far, but Any input would be appreciated!
You can use just about any type - it depends what you're going for. Often for bullets I prefer to just use Area2D since they're going to just detect the hit and disappear. If you want gravity/bouncing/etc, a rigid body might work better for you. In gamedev there are often multiple solutions to a problem.
Hey thanks so much. I originally tried using rigid body cannon shells, but i couldn't figure out how to get them to go to a particular location ( where ever the tank happened to be located) when they were spawned. I'd prefer rigid body since their gravity and bouncing would look more realistic when bouncing off buildings or blocks. There is no set_pos function for rigid body, right? So how would you spawn a child at a particular location the moment the player presses the space bar to fire?
Well, had I watched the video till the end, the answer to my question was already in the video, namely which is using get_transform and set_transform for rigid body
You show in the video a new way to do a asteroid clone. Should we use this approche or use a Area2D like you did in the asteroid tutorial ?
You can - it's got pros and cons. If it's working fine, it's not really worth switching. I did find it worked better to use Rigidbody2D for the asteroids themselves.
This is exactly what I wanted .
(But for Rockets following a player)
Please update this.
I'm pretty sure I already replied to you in another thread. I have seeking missiles in my topdown tank demo: ua-cam.com/video/KAUP4nlJyz0/v-deo.html
can someone tell me what is offset
It's the point where the force is applied. If you punch a cube at its edge, it might rotate.
Thank you so much for all of your programming help. You are excellent at explaining things, and have been a great help for me learning to make stuff. thanks :)
Nkfjfjjfjjjdjhehrujjsjjjjekjajkjehhgjwksghjjjnjsankjkjjjjjkmmjjjsjejejjdjdkkdskskkddkkdjshjjj jjjjjkkjjjjjjhhjjjjkjjhhhjdbjmhjnjddjjnzjzxjjzjsiizskzkkdjkzkjjxjxmkdkdjdjdjkfkcjjdkkkfjfjfiffikkfmkmfkfkofogkcncckjfjfjjcjfvkvkfbnfovkkffjhfjfjckcifjfjfjjdikdbdxjhdjfndhjhxhdbbdjxjjdjdkedjjnxjjjjixkkxjxjcjdhhcjxmxk m’mxj ugh gbxnbxbhbdhhxhgssxhgggxgghg G fdgxgffxgxggzhgsjegsdbjdjdjfy kvjhihnjcjxjjfjzjdjdkxndkxmmxmfmcjfjfjfkxjfndndmcnhcydh th rjigtiitirjkrkdk he ifhjwbdjdjj&;!,!),),&$,$$,’fhbx
Muchas gracias por tus vídeos!
Hmmm, this does not work properly at all in ver 3.2.1. The screensize variable needs screensize = Vector2() otherwise it will give a get null error. When applying the func _integrate_forces the ship always remains half offscreen at the top left and when applying thrust, it moves very slow and then tries to move backwards, very strange. It works fine (except for off-screen teleport).
If it works for you, would you mind adding the code that works? Love your tutorials by the way, One of the best so far in the Godot World.
Hmmm, looks like the screensize = get_viewport().get_visible_rect().size was the issue. When I pit the vectors in manually then there is no issue and it works
@@leeramer171 thank u
@@user-lq1jn5nd4d You are welcome
So i'm currently making a game (Wich is possibly due to your tutorials, thanks!), but in Godot 3.0 they removed the opacity option in sprites. And i want a sprite to slowly fade in. How do i do this now? I've looked all over the internet but nothing about it in Godot 3.0
In 3.0, opacity was removed because it's redundant with the "modulate" property's alpha value. To change a sprite's opacity to 50% for example, you would do
$Sprite.modulate.a = 0.5
Ah I see, thank you! But what's the 'a' for at the end of '$Sprite.modulate.a'?
Follow the docs:
- Sprite inherits CanvasItem (docs.godotengine.org/en/latest/classes/class_canvasitem.html)
- The CanvasItem.modulate property is of type Color (docs.godotengine.org/en/latest/classes/class_color.html)
- Color has properties r, g, b, and a (alpha) In RGBA color, the "A" represents the transparency value from 0 (fully transparent) to 1 (fully opaque)
aha thank you, i understand now!
Excellent tutorial. Thanks a lot!
This has been super helpful, thank you! Playing around with the rigid bodies is going to be fun.
But there's a thing I'd like to know. So I'm making a 3D platformer with attack combos.
It's fine that my character can push around a box or a ball by simply colliding with it, but how do I apply a directional force to the physics object when I punch or kick the object?
Hey, would you please consider making further python tutorials perhaps on the basics and even more pygame tutorials? I would really love more content on python. Something specifically that I would like to learn more about is classes in python if that would be possible. Your videos are honestly the best resource I have found on UA-cam, and the structure of your videos really suit my style of learning, and I would really love more content on python to further extend my knowledge :) Thank you!! :D
I'm not against it, but right now I'm very busy with Godot-related material because of the 3.0 release. After that, we'll have to see what happens. In general, I'm sort of frustrated with the state of Pygame. I love using it from way back, but it's so out-of-date and showing its age, especially compared to frameworks like Love2D.
In the meantime, if you're looking for more about the basics, this is my favorite Python book: openbookproject.net/thinkcs/python/english3e/ and includes a good chapter on objects and classes.
What an amazing resource, thank you soo much for showing me this.
I am currently completing your platformer pygame series and I also want to end up completing the tile based game series. I really enjoy completing projects which is why I like your pygame series. Do you recommend for me to continue applying my basics with projects and develop with them or go back to the theory side of things (online courses, books, etc
I also really enjoy object orientated programming, which is probably why I really enjoy game development, however I understand that C++ or Java may be better for stuff like game dev. (correct me if I'm wrong!)
Should I continue with python or venture into another language such as C++ or Java if I want to continue game development. I've been looking around at Unity, (which uses C#?) as well. (I guess I could learn both as well!)
Right now I'm 15 and coding is a passion for me, and my ultimate goal is to study and pursue a career in software engineering. I really want to make sure that I know what I should (and shouldn't) be doing. I think I'm coming off as a little paranoid right now but I hope that's okay :)
So, the main difference between _physics_process and _integrate_forces is that the latter allows non physics properties modifications to the RigidBody2D. Am I correct? Does it come with drawbacks? Why not use _integrate_forces by default for all physics management then?
The documentation is a nightmare to understand anything and I'm very happy that people like you are making tutorials about Godot. I don't know what superpowers you have to manage to make sense of the documentation. This is beyond my understanding...
_integrate_forces is specifically for rigid bodies, when you need to do something custom to the physics. _physics_process is for when you need code on any node that runs synchronized to the physics timestep.
As for the documentation, are you talking about the class reference? Because that's intended for developers - it's a reference, to give you the information you need when you know what you're doing, but just need to look up a function or definition. I'm just guessing here, but if you're new to programming, that's why it seems not to make sense to you (yet). Educational documentation is very different, and can be found under the "Getting Started" and "Tutorials" sections.
@@Kidscancode Well, actually I was specifically talking about the Getting started and Tutorials sections. The API documentation is really good but to get the most of it, one must understand how the general engine works. And that's exactly what the educational part is lacking: understandable content. It explains the inner workings of each part of the engine without any explanation nor examples on how to use it. It's more a design choices list than a helpful "getting started" part. Over everything else, I want to learn how to use the engine then have some explanations on why use that technique rather than another (just like this video does). I cannot make sense of anything in the documentation. Each time I read a section, it's too technical and useless. It's not beginner friendly. Even the example projet is only a follow through tutorial without clear explanations of techniques that I can transfer to a personal project. I do understand that a first project can be a features show to get an overall image of the engine but it should be followed by a thorough analysis of the project done in order to understand it fully. That's why I really enjoyed your Godot 101 series: it's really detailed and helped me get a solid grasp of the engine. Before that, I tried many times to make sense of the documentation (nearly two years now) and couldn't even make a simple Pong. With only the first five videos of your 101 series, I could at last do it. I learned some small but really useful tips (like hovering over a property in the Inspector to know the exact name of the property in GDscript) from many sources (mostly youtube channels and discord servers) but none come from the official documentation.
Love the tutorial. Do you have any suggestions to change the physics behaviour? I need an object to basically behave like a kinematic object when under direct control of the user, and as a rigid body when the user releases control
That's a good question. My first thought would be to toggle the mode property from MODE_RIGID to MODE_KINEMATIC. The tricky part will be in handling the transition smoothly. Sounds like a fun project to tinker with.
KidsCanCode i’ll let you know how a manage when i tackle it:) on holidays atm:)
Thank you!
I wish I'd got this video before I spent a week trying to change an object's physics inside _physics_process(). Docs and tutorials should point users to _integrate_forces() by default.
This tutorial helped me a lot. Thank you!
You're welcome!
Anyone know how to increase the min and max speed of the creeps as time goes on so that the challenge gradually increases. This is my failed attempt, please don't judge me too harshly ;) :
func speed_increase() -> void:
if score > 20:
$Mob/MAX_SPEED = $Mob/MAX_SPEED + 100 and $Mob/MIN_SPEED = $Mob/MIN_SPEED + 10
Just do it when you spawn the mobs. The main scene sets the speed of them when they are instanced. Add a time-related value to that.
Why is this question posted on the RigidBody video?
@@Kidscancode Thanks a lot I came to that conclusion, however, I am quite sure the code could be neater:
mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED, mob.MAX_SPEED), 0).rotated(direction))
if score > 15:
mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+100, mob.MAX_SPEED+200), 0).rotated(direction))
elif score > 30:
mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+200, mob.MAX_SPEED+400), 0).rotated(direction))
elif score > 45:
mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+300, mob.MAX_SPEED+600), 0).rotated(direction))
elif score > 60:
mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+300, mob.MAX_SPEED+600), 100).rotated(direction))
elif score > 75:
mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+500, mob.MAX_SPEED+1000), 200).rotated(direction))
elif score > 90:
mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+600, mob.MAX_SPEED+1200), 300).rotated(direction))
elif score > 105:
mob.set_linear_velocity(Vector2(rand_range(mob.MIN_SPEED+700, mob.MAX_SPEED+1400), 400).rotated(direction))
else:
null
Thank you so much for all your lessons :)
thanks for this tutorial. I just finished the asteroid tutorial (15 parts). Did you put the code into github for this video ?
Hmm, I didn't because it was such a small project. I can put it up as soon as I get a chance.
I did copy the code manually it's not the long, but for someone that just want to play with it or search code in github it's fun to have code . thanks again for the video. I had a good time watching them all week
I really just made a game about a rocket dodging orbiting and falling asteroids, using just kinematic bodies... How the hell did I forget to use rigid bodies hahaha?!
Guess it's just me being a control-freak.
You just made the base game for Angry birds
really useful
Thanks for the explanation, I now understand physics in godot much better.
The first step, HOW DO I EVEN FIND THE RIGID BODY
I keep thinking he's saying Twerk
my godot not have rigid bodies :v
ASSETS ARE HERE..... kenney.nl/assets/physics-assets
:)