Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Stop Nesting Your Dash and Dive Events in GDevelop — Here's Why They Get Stuck

If you've ever wired up a dash and a dive in GDevelop and watched them fuse into one unmovable blob, you've hit the linked-event problem. It's one of the most common 2D platformer bugs in the engine, and the fix is simpler than you think. This isn't a beginner mistake. It's a GDevelop-specific gotcha that comes from how the engine processes event chains. Let's break it apart. What's Actually…

When you combine a dash and dive action within the same event condition in GDevelop, the game engine reads them as a single continuous logic chain. This results in the player getting stuck mid-animation, inputs stopping registration, and the character appearing frozen. The issue lies in GDevelop's evaluation of nested actions within the same frame tick.

To resolve this, separate the dive action into its own event block. Begin by preparing your sprite with both "Dash" and "Dive" animations. Install the Dive Dash behavior on your player object, but refrain from adjusting its default speed and distance values until the logic is functioning properly.

Next, restructure your event sheet. First, create a condition for pressing the X key, followed by an action to simulate the dash. Then, create a separate event block with the X key press condition and an action to simulate the dive. This change ensures that each state transition is processed independently.

To prevent players from spamming dash/dive endlessly, implement animation-state guardrails. Add conditions checking the current animation name to avoid starting a new action while in the same state. This creates a cooldown tied to animation length, eliminating the need for timers.

With dash and dive now as independent states, you can introduce additional mechanics. For example, you can make destructible environments react to the player being in the "Dive" state upon collision with breakable blocks. Stomp attacks can trigger damage when the player dives into an enemy's top hitbox. These mechanics depend on cleanly separated movement states.

The key rules to remember are: if actions get stuck together, they were nested in the same event block; animations are state indicators, not just visuals, so use animation name checks to gate actions; and gate infinite movement early by implementing animation-based guardrails, which are more intuitive and cost-effective than timer-based cooldowns. By separating logic first, then polishing speeds, friction, and frame counts, you'll have a responsive platformer that runs smoothly.

Rewritten by urgent.news; may contain errors — check the original.

Read the original at dev.to →

Report a problem with this story

More in Tech

Hafif IDE'lere Dönüş / Back to Lightweight IDEs

Sparky-Family'den yeni bir bakış açısı. A new perspective from Sparky-Family. Splash Code Studio [TR] Hafif IDE'lere Dönüş Yazılım geliştirme araçları her geçen gün ağırlaşıyor.

  • Sparky-Family releases Splash Code Studio as lightweight IDE alternative.
  • Splash Code Studio offers 2GB RAM startup and 30-second startup time.
  • IDE focuses on speed, customization, and offline functionality.

Solana Transaction Fees Explained: Base Fee, Priority Fees and Landing Cheaply

Short version: a transaction on Solana pays a tiny fixed base fee and an optional priority fee. Base fee is a fixed amount of lamports per signature and it goes to the network.

  • Solana transaction fees comprise a base fee and a priority fee
  • Base fee is charged per signature and goes to the network
  • Priority fee compensates block leader and varies by transaction urgency

Searching a 40,000-Follower List Without Scrolling: Design Notes From Building It

Disclosure: I'm one of the people who built the tool linked in this post. I'm sharing the design thinking, not selling anything. Some AI assistance was used to draft this and I edited it.

  • Search at the source when possible to reduce requests and speed up the process.
  • Cache by the question, not the user, to optimize cache usage and performance.

S3 vs REST Storage: Choose by per-User Generated Image Controls in Node Express

Short answer: store every AI-generated image under a server-built users/{userId}/generations/ prefix, keep objects private, return expiring signed download links, delete known keys during user…

  • Use users/{userId}/generations/ prefix for tenant isolation
  • Implement application-level ownership checks for reads, deletes, and signed links
  • Choose between Infrai library or Amazon S3 based on team's preference

More from Saturday 21 November →