How to resolve 2D NPCs stuck on top of player's sprite issue?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By GilbyScarChest

I’m working on a 2D game which involves a follow-along NPC companion. When my player jumps, the companion jumps right after. However, often the companion will land on top of the player’s sprite and the player will no longer be able to jump, and because of that the companion can’t jump off. Eventually, the player can no longer move at all for some reason. I can’t seem to figure out how to resolve the issue.

I tried changing the shape of the CollisionShape to something more round, but it still happens sometimes and it doesn’t fit the shape of the character quite as well.

Does that mean your player and its companion can collide with each other? If not, I don’t see a reason why one would prevent the other from moving Oo

Zylann | 2019-07-05 22:35

They can collide with each other, yes. If I turn off the companion’s collision box, I was worried the companion will just fall right through the ground.

GilbyScarChest | 2019-07-16 00:08