Ever had the problem where you’re firing a bullet or some kind of projectile at high speeds, and it just goes right through the collision object, instead of hitting it?
Here’s a weapon that fires a bullet at random velocities, to demonstrate the issue:
The bullets impact the character in various places, rather than at the first point of contact. I haven’t found a way to enable any kind of continuous contact option, outside of playing with the
safe_margin
setting. I ended up adding a raycast:
It’s definitely a hack, though. The
move_and_collide
should be replaced by the ray query. Using both instructions together could result in an even weirder situation;
move_and_collide
could skip a collision object (the issue we’re trying to fix with the ray query), but then still collide with a different collision object. Then the ray query redoes the same movement and collides with the first object that was missed by
move_and_collide
. Depending on the game, that could mean something like randomly shooting through shields or walls under specific circumstances.
The current approach is essentially a two-pass solution, where the first pass is sloppy, and the second pass works as intended, but doesn’t move the projectile.
Just a couple of days ago, Godot 4.0 alpha 17 was announced. Today, Godot Engine 4.0 beta 1 was released. Be sure to check out the announcement. There are lots of improvements across the board; rendering, lighting, physics and navigation, animation, and scripting.
In this 2018 GDC session, Spry Fox‘s Daniel Cook explains how to keep human beings from being treated as interchangeable, disposable, or abusable when designing multiplayer games. If you’re developing, or thinking about developing a multiplayer game, this is a great talk to better understand the challenges of designing multiplayer interactions that result in more …
Here’s a tutorial on how to create breakable objects in Blender and Godot. It covers the steps needed to design and implement breakable objects, including scripting and using physics properties to make objects break apart into smaller pieces upon collision or other interactions.
Right after I got my Steam Deck, I wanted to know how hard it is to get a Godot game running on it. What’s the developer experience for someone who’s stepping through this for the first time? It was really easy to do, so I’m sharing this here, whether you’re following along or like to …
Projectiles going through collision objects
Ever had the problem where you’re firing a bullet or some kind of projectile at high speeds, and it just goes right through the collision object, instead of hitting it?
Here’s a weapon that fires a bullet at random velocities, to demonstrate the issue:
The bullets impact the character in various places, rather than at the first point of contact. I haven’t found a way to enable any kind of continuous contact option, outside of playing with the
safe_margin
setting. I ended up adding a raycast:The ray cast looks somewhat like this:
It’s definitely a hack, though. The
move_and_collide
should be replaced by the ray query. Using both instructions together could result in an even weirder situation;move_and_collide
could skip a collision object (the issue we’re trying to fix with the ray query), but then still collide with a different collision object. Then the ray query redoes the same movement and collides with the first object that was missed bymove_and_collide
. Depending on the game, that could mean something like randomly shooting through shields or walls under specific circumstances.The current approach is essentially a two-pass solution, where the first pass is sloppy, and the second pass works as intended, but doesn’t move the projectile.
Related Posts
Godot Engine 4 reaches beta
Just a couple of days ago, Godot 4.0 alpha 17 was announced. Today, Godot Engine 4.0 beta 1 was released. Be sure to check out the announcement. There are lots of improvements across the board; rendering, lighting, physics and navigation, animation, and scripting.
Design Patterns for Building Friendships
In this 2018 GDC session, Spry Fox‘s Daniel Cook explains how to keep human beings from being treated as interchangeable, disposable, or abusable when designing multiplayer games. If you’re developing, or thinking about developing a multiplayer game, this is a great talk to better understand the challenges of designing multiplayer interactions that result in more …
Making breakable objects in Godot
Here’s a tutorial on how to create breakable objects in Blender and Godot. It covers the steps needed to design and implement breakable objects, including scripting and using physics properties to make objects break apart into smaller pieces upon collision or other interactions.
Running Godot Games on Steam Deck
Right after I got my Steam Deck, I wanted to know how hard it is to get a Godot game running on it. What’s the developer experience for someone who’s stepping through this for the first time? It was really easy to do, so I’m sharing this here, whether you’re following along or like to …