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.
Per feedback, we’ve exposed more inventory user interface component signals to make it easier to react to slot/item interactions with custom logic. New features: In addition, these bug fixes are included:
Godot Engine is an open-source game engine. With the 4.0 release on the horizon, it’ll gain quite a bit of attention. And it’s an engine worth keeping an eye on. Internet Gaming. Serious business. Game development is serious business. The global gaming market size was 203 billion USD in 2020 (per fortunebusinessinsights). It is predicted …
For some reason, my Godot game would no longer launch on the Steam Deck. I could hear it running as if it were running in the background, but the screen kept showing the Steam Deck’s UI. Since it’s all Linux I figured it should be possible to just drop to the command line and launch …
The latest version includes a few new enhancements, and an experiment: The sequencer demo uses inventory instances to hold music notes, which can be played back. This was inspired by music trackers that were popular in the 90s, such as Scream Tracker and Impulse Tracker. The sequencer isn’t meant to be a production-ready digital audio …
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
Inventory System v1.6 available
Per feedback, we’ve exposed more inventory user interface component signals to make it easier to react to slot/item interactions with custom logic. New features: In addition, these bug fixes are included:
Is Godot is the Linux of Game Engines?
Godot Engine is an open-source game engine. With the 4.0 release on the horizon, it’ll gain quite a bit of attention. And it’s an engine worth keeping an eye on. Internet Gaming. Serious business. Game development is serious business. The global gaming market size was 203 billion USD in 2020 (per fortunebusinessinsights). It is predicted …
Launching Godot Games on Steam Deck from the command line via Remote Shell
For some reason, my Godot game would no longer launch on the Steam Deck. I could hear it running as if it were running in the background, but the screen kept showing the Steam Deck’s UI. Since it’s all Linux I figured it should be possible to just drop to the command line and launch …
Inventory System v1.8 available
The latest version includes a few new enhancements, and an experiment: The sequencer demo uses inventory instances to hold music notes, which can be played back. This was inspired by music trackers that were popular in the 90s, such as Scream Tracker and Impulse Tracker. The sequencer isn’t meant to be a production-ready digital audio …