#Area2D Collision does not detect player body sliding in

1 messages · Page 1 of 1 (latest)

bleak trout
#

Hello! I've been using Godot 4 over the past few days to make a small game (for a school project) and i'm facing an issue which I can't figure out.

The Ice Sections are a single node (unsure if that's what i should call it? it's a separate scene that gets thrown in later along with the player, and world.)

The player, collides and slides correctly when entering in the first ice section, but the moment he exits and instantly enters another section, the game doesn't seem to detect it.

#

is_sliding just takes care of calling sliding() btw

lime oyster
#

the player is entering the next ice area before exiting the previous one, so is_sliding gets set to false after exiting the first area. two other ways you could handle it:

  1. turn is_sliding into an int, and have the areas increase/decrease the value by 1
  2. put the slide area detection on the player instead, using a separate area and calling has_overlapping_bodies() or has_overlapping_areas() to check for the areas