Collecting Objects

Hello there Panda3D Forum,

I have a game and I have a character, but I want that Character to collect objects that are floating around in my Map.

How can I do this?

Can you be a little more descriptive? Do you just want to collect objects and put them in inventory? Do you want them displayed somewhere?

I want them to be like Crash Bandicoot-style, they should disappear when I get to them and I would like to count how much Ive collected :slight_smile:

Thanks for the reply

Collisions might help you to achieve that effect.
Astelix created a post in the showCases with tutorials to start with collisons.

Yeah, it should be pretty easy using CollisionHandlerEvent. In your event handling function you just remove the object you picked up from the scene graph (object.removeNode()) so it disappears. Play a quick sound if you want. Then either add an instance of your object class(whatever you picked up) to your inventory, or increment a counter or something (i.e. coins += 1).