Pickups with some physics

Hello,

I am trying to implement 2d pickups with just a plane and texture, and it will bounce out when spawned(enemy death). The pickups will then bounce until it comes to a stop. When player gets close enough the pickup will travel towards him. Sounds easy, but I hit a few snags.

I implemented it with a rigidbody and bouncy physics mat, but when the player collides with the pickup he has a little bounce to him before the pickup is finally destroyed. Destroy call is happening in OnCollisionEnter() btw. Maybe I am missing something to prevent this? Also, Is there a way for it not to collide with other certain rigidbodies, don’t need it to bounce off other items spawned with the enemy?

I also implemented it using a trigger, but I am losing out on physics. Seems I would have to handle my own physics in OnTriggerEnter?, how would I go about to do this? I would need to bounce off of walls and the ground.

Any help appreciated.

There are a few ways I can think of to do this, but the most straightforward (I think) is to simply set your pickups to ignore collisions with the player.

Thanks

Sounds like it will work. That will prevent the pickups from hitting enemies and will prevent the bump when player picks it up. I guess I would need some other type of collision detection inside the player for picking them up ex: Overlap/CheckSphere?

That’s a good point. I reckon you could probably attach an empty game object to the pickup and attach a collider [trigger = true] to that, and use that for detecting the player.

That’s a good idea, Ill see how that works.