Great video. So far so good, a bit of syntaxes have to be adjusted to fit the newer verision of godot (4.3 RC2). I had a problem where it ignored a fall point and went thru my platform to the point beneath it (wich was an edge point on a lower platform) Don't really know why it ignored the fall point and took the edge point below, probably has something to do with the cell_size or something like that. Used a variable for max fall distance to get rid of the problem. Will probably try to redo this with the AstarGrid2D in the future.
I just cant get the intersect ray to work at all. It just returns empty no matter what i try. I am using a TileMapLayer node instead and for some reason it just wont work. I get my debugging faces to line up so i have one at the correct position to the left side of the edge and then i have another one below that point past the tilemap. the tilemap layer node dont have the map_to_world function but from reading the docs it seems like to_global(tileMapLayer.map_to_local()) should do the same. The PhysicsRayQueryParameters2D is set up with the from and to and i also tried to enable and disable the collide_with_areas and bodies. I still get nothing.... Anyone have any idea on why? If i add an area and collision shape manually it will register that shape. But not the tilemap collisions...
So figured the problem out. I added a small delay of 0.1 sec before we create the map. For some reason it seemed that the tilemap collisions was not ready when i tried to perform the intersect ray. Maybe it will help someone else that encounters this problem.
Excellent tutorial. Took a bit of handwork to convert it to Godot 4.2, but in the end it turned out great and works well! Concise, in depth explanations, and exactly the help I needed. 10/10
For anyone getting the (Member "velocity" redifened) ERROR: now vector2() is part of velocity in GODOT 4 so you simply have to deleted the 3rd line in the video
How do I get this to work? In my game, i dont want to have the bullet follow my mouse. Rather when the player flips left or right, the bullet with then shoot left or right. I was able to follow your vid and get the bullet to shoot to the right fine. Just need to be able to shoot to the left when the player faces left. Any ideas would be great ❤
What if i wanted to split an asteroid in two smaller pieces when my bullet hits it. ive already made the big asteroid dissapear but i cant figure out how to instantiate two objects at different positions. Help?
It is easy and simple.You just have to make the bullet have in its own group.Use an area node in the asteroid script to detect if the bullet(using the body and group name) has hit it.if this does then use the same functions used in the video to make it split into two pieces.(I haven't watched the video yet.so I can't tell if the process might be that easy or not.but good luck understanding the code,the works will be the same) And you will be able to split the asteroid into many pieces as you want after you have done it.(But a quick reminder don't fall into any kind of rapid hole .if you find it hard to complete it within 2-3 days then stop developing games for a while.you will simply find the answer to the solution by interecting with the outside world. But don't get into fixing it immediately as you find the answer cuz you may lose courage to dev if you fail again.so only with enough gathering information and courage get into It
Unfortunately, with the update to Godot 4, the intersect_ray() function now only requires one argument, and I'm not sure how to correct for this in the code. It's now throwing errors at line 171 and 178 for this block "var result = space_state.intersect_ray(pos, pto)"
I was about to fix this by adding a new variable. "var query = PhysicsRayQueryParameters2D.create(pos, pto)" and updating the next line to "var result = space_state.intersect_ray(query)"
This is good but is there a way to do this with one scene Just think of the thousands and thousands of rooms in your normal RPG there's no way to keep that organized
Hello, thank you for your amazing tutorial I followed it in godot 4 but its give me some errors like type[1] give me null or all grids fill with face Do you know how I can fix them in godot 4? Thank you again❤💕
This may be an easier way to do this, in case people are researching this: I have a scene for the gun which i put these 3 lines and one for the gun, so i had to reference my player @onready var player = get_node("/root/Game/Player") var aim_direction = Input.get_vector("aim_left","aim_right","aim_up","aim_down") look_at(player.global_position + aim_direction) also the input map shows a setting for dead zones on each input map which defaults to 0.5
I had a problem with this, you are using Vector2 to check if a cell is in cells, but cells is an Vector2i array which makes all comparisons fail. I changed the Vector2 to Vector2i and all my problems were fixed. Note that usually when comparing exact values ( == ) is better to use integers, and if you need to compare floats, it's better to compare ranges and not exact values. Great video btw.
there are different ways you can do that, what I do is that I create a VsibleOnScreenEnabler2D node in my bullet scene, set it up, connect the on screen exited signal to the script and then queue_free() it. the whole process takes about 2-5 minutes you can look it up on youtube
@@Aminrexa I been waiting for you to response, thank you. I know no one asked but im still 15 and im trying to learn as much godot as I can and me and my friends dream game.
@@ValidShortking that's actually a perfect age to start learning game dev, I'm also a beginner still learning Godot and GDScript, just remember making big games takes lots of time and patience, for now keep making smaller projects to both learn new things and improve your skills, don't spend all day watching tutorials, keep working on your project and look up a specific tutorial if you're stuck somewhere, wish you the best
Hello ! This video is a bit old but does anyone knows why when I move my pivot position (something else than 0,0) it stops working with the joystick but still works with the mouse ? I know it's caused by the position vector but I don't understand why exactly :(
you probably wont repsond to this but i followed brackeys new godot tutorial, and i tried copying this to make a gun shoot. i have the gun always facing towards the mouse while as a child of a parent, and have everything working including the instantiating. The player is a scene, in a Game scene. When i shoot, the bullet comes from a random position, that moves further, the more i move my character
Hey, awesome video - thank you for making it! Extremely helpful in understanding node generation for a 2D platformer map. Just a quick note - When you printed out the number of nodes at 22:18 it returned 44, but there are actually only 42 nodes on the map (I counted multiple times). There must be two extra overlapping nodes created somewhere, but I'm not sure which ones are being duplicated. My gut thinks maybe there's one on each "middle step" of the tiered diagonal spaces (at the middle-left and bottom right of the map) because those are the first two spots with potential weird conditions that jumped out to me, but you're checking for nodes in the same position before generating a node, so I'm not really sure where the extra two are coming from. I'd recommend doing a quick for each loop and print each cell's coordinates to see if any are still being duplicated or almost duplicated (maybe off by a small decimal or something?)
Thanks for the comment. Because this code generates a node at ever corner it also generated 2 nodes above the map outside of the screen area, even though the area is completely unreachable
Thanks for the tutorial, you can't image how helpful this video is for me. Here is a question about this tutorial. In my game, when my character jump up or drop, its horizontal speed will be changed to zero, which leads to that my character can only jump straightly up or down, how can I fix this??
Make sure your adding to the y velocity only. Not touching the x velocity. Another potential issue is it's still trying to move toward the node it jumped from causing it to just jump straight up
@@arithmetic1938 is there a way to do this in Godot 4? I am new to godot/game dev and have been referencing your videos how to get this set up (lots and lots of trying to update the code into godot 4) right now i am trying to figure out how to get them not to jump straight up, but the only way I've been able to move the character is by velocity. Haven't found any way to move them in any other way that isn't just teleporting them also you are a god for responding 3 years later
Thank you so much for this great in-depth tutorial. Do you think platforms (that you can stand on as well as pass through upwards by jumping and backwards by dropping) would be possible to implement with a method like this one? Or maybe even more complicated mechanics such as a Mob capable of climbing ledges?
Niceee! this works :) had to change some stuff with godot 4: extends RigidBody2D var ball_speed = Vector2(200,200) func _physics_process(delta): var collision_info = move_and_collide(ball_speed * delta) if collision_info: ball_speed = ball_speed.bounce(collision_info.get_normal())
The correct code for godot 4 with a CharacterBOdy2D its: extends CharacterBody2D var ball_speed = Vector2(200,200) func _physics_process(delta): var collision_info = move_and_collide(ball_speed * delta) if collision_info: ball_speed = ball_speed.bounce(collision_info.get_normal())
Good tutorial ! If anyone see this issue "Invalid get index 'normal' (on base: 'KinematicCollision2D')." In line " velocity = velocity.bounce(collision_info.normal)" change to collision_info.get_normal()
you probably wont respond but why does my bullet only go right even with all the code? its spawning where it should its just not going anywhere else except right im also using godot 4