# Making pickup objects with gravity that won't push the player on collision

I am trying to create pickups, that appear after an enemy dies, and that the player can pick up, but I am running into some issues.

First of all, I want the pickups to be affected by gravity, so I need a rigidbody2d and a boxcollider2d (non-trigger), so this works.

Now, if I want to collect the pickups on contact, I need to make the layers for the loot and the player get in contact, so that they can interact.

Now, of course, I do not want to push the pickups around. I want to actually pick them up when I touch them, but the collider is not a trigger so I thought I would use OnCollisionEnter to handle this.

        void OnCollisionEnter2D(Collision2D other)
{
var loot = other.gameObject.GetComponent<ILoot>();

loot?.PickUp(gameObject); // Destroys also the pickup
}


While this works, I am still using a non-trigger collider, which means that there are some physics effects that are not desired. For instance, when I "jump" onto the pickups.

Notice the subtle, but still present, slowdown in the fall, when the player enters in touch with the pickups?

How could I solve this issue??

Now your player character will get OnTriggerEnter2D messages when they walk close enough for their child trigger collider to touch the pickups' solid colliders, but your player can still pass through the pickups because they don't interact with the player's solid collider.
• If you're already at your limit for physics layers, you can get rid of your "player trigger radius" layer/child object, and replace it with a Physics2D.OverlapCircleNonAlloc() query to scan a radius around the player for pickups to collect each frame. – DMGregory Jul 3 '20 at 12:16