Physics Stuff Questions

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By The_Duskitty
:warning: Old Version Published before Godot 3 was released.

So i have 2 questions

  1. Im trying to make a platformer but i’d like to get rid of that god awful thing where you go into the ground when you land

  2. I’d like to know if there’s a way so when I make these coins drop they can pass through eachother and Not land on eachother but still land on the ground

Examples

I don’t know what happens in 1), maybe there is something wrong with your collision objects.
But for 2), I think you can toy with collision masks so coins only enter in collision with the ground but not themselves. Also you would want to give them a second collision shape linked to an Area2D so the player can pick them based on a bigger shape.
(sorry no elaborated answer, I’m going to sleep in a few seconds :p)

Zylann | 2016-09-20 01:00

There are more ways to implement a platformer than the reference implementation in the tutorial example, and any answers to your first question are going to be fairly specific to that implementation.

But #2 is easy to achieve. Have the coins not exist on any Layer (by default they exist on the first layer) – this will make it so that nothing collides with them. Then have the coins Mask on the second layer (again those default to the first) – this means that they’ll notice when they collide with anything on the second layer. Then make sure all of the solids you want the coins to collide with exist on Layer 2 in addition to Layer 1, that way they’ll stop on the same things that the Player stops on but they won’t actually stop on the Player.

Then give each of the coins an Area2D child which has no Layers and Mask 1 (so that it checks for collisions on Layer 1 but nothing checks for collisions against it) and connect its “body_enter” signal to check if they’ve just entered the Player.

Hammer Bro. | 2016-09-22 23:43

:bust_in_silhouette: Reply From: Freeman

It looks to me that you need to set properly collision masks and layers of your coins that need to take the same space with other coins.