#CharacterBody2D needs to push another CharacterBody2D

1 messages · Page 1 of 1 (latest)

zenith gull
#

I'm working on a multiplayer platformer for my current project, and I've been having an issue. I'm working with 4 players on the same screen, and everything works fine for the most part except for some problematic interactions:

  • You can't jump when a player is on top of you
  • You can't push or be pushed by other players

I'm trying to get a system where in theory, 4 players could sit on each other in a stack and the person on the bottom can carry everyone on their back. Sounds silly, but I'm trying to go for something more interesting besides just bouncing players off each other's heads. Maybe I can use rigidbodies as children to check for collisions and then apply forces as needed? I remember attempting this before but no luck yet.

Any ideas?

primal cliff
#

when colliding

#

It will push other players

zenith gull
#

The hard part is knowing how to detect a collision... maybe I need to set up my area nodes differently

primal cliff
#

try last_slide_collision

#

etc

#

something like that

#

on CharacterBody2D

zenith gull
#

Oh shoot I didn't see that method. I'll look into it, thank you