Area2D as an object container?

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

I have a small learning project in which I want to make a tiny mancala game, however, I realized that I haven’t really worked out how to make it so the stones “fall into” each of the pockets and stay there.

Is there any way to “invert” the way that collision boxes work? So that the object only collides with the borders of the CollisionShape2D after it has entered it?

My idea was that once the player selected a pocket, an object would grab all the seeds inside it and drop them one by one inside the following pockets, but would rather not use physics objects, since I don’t really know how to use them properly.


:bust_in_silhouette: Reply From: rballonline

I think the answer you’re looking for is on the Area2D, expand the Collision and play with the collision layers. I believe you’d want to uncheck the world Layer if you’re still setup with default layers. Then there won’t be any collisions but you can still tell when something has entered the shape. HTH

Found a solution fiddling with the linear damp and gravity settings, but thanks for the advice! I keep forgetting about the helpfulness of masks and signals.

Lazarwolfe | 2020-11-15 18:43