Mining Tiles in Godot @Aarimous
Mining Tiles in Godot  @Aarimous
Uploaded April 2024 | Updated September 2026, 3 weeks ago
Watch the stream here:
twitch.tv/aarimous

#shorts #godot #aarimous

Godot Docs for PhysicsBody2D.move_and_collide:

docs.godotengine.org/en/stable/classes/class_physicsbody2d.html#class-physicsbody2d-method-move-and-collide

Note: I am setting test_only = true in my function call as I want to only test if a collision would occurred if the character moved in the mining direction. You may need to play with your motion vector to get this to work as desired. If you need more help, feel free to stop by my Twitch stream so I can help you out.

Godot Docs for KinematicCollision2D.get_collider_rid:
docs.godotengine.org/en/stable/classes/class_kinematiccollision2d.html#class-kinematiccollision2d-method-get-collider-rid

You can then use the Tilemap.get_coords_for_body_rid() to get the cell for the RID which you collided with. Then at that point you have the exact cell for and can do your own logic on the sell.

Docs for Tilemap.get_coords_for_body_rid():

Tilemap.https://docs.godotengine.org/en/stable/classes/class_tilemap.html#class-tilemap-method-get-coords-for-body-rid
Mining Tiles in GodotIs my game better turn based?Most Noita Thing EverHow I do Sound Effects in GodotCards, Hexagons, and Workers - Hexagod DevlogWe made a mistake..Is the Game Fun?After 3 Months of Full Time Solo Game Dev..I Might be Ruining my Game..But I am Struggling to Find the FunGame Dev, YouTube, and Why I Keep GoingYou Dont Owe them Anything
Aarimous |

Mining Tiles in Godot

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER