A collision detection problem

Hi guys. I didn’t really understand the part about Collision Detection in the P3D manual. What I want to do, for now, is to take the Roaming Ralph code, and add my own object in the world.

I did that and Ralph just goes through the object, even though from what I understood the collision detection code in the original program should take care of any objects I put.

I guess I’m missing something really basic here, so if anyone can to point me in the right direction, that’d be really nice.

Say I want to put a bottle of milk in the Roaming Ralph world, and I want it to disappear as Ralph touches it (as if he’s eating it). How do I do that?


that’s all

I see you practised. :slight_smile:

I’ll try to find(write) the sample you are looking for, but the search is broken so don’t expect it’ll be immedately. :wink:

I have practiced and read the manual, the collision detection part is not very easy to understand. I’m sure that if I saw a simple code of a character bumping into an object it’ll be very helpful.

I’ll be happy to receive any kind of help I can get guys. Thanks.

You need to make a collision solid for that bottle of milk before anything can collide with it. It’s recommended to use the default solids, but sometimes (in the case of a terrain + trees with Roaming Ralph) that gets kinda hard.
So, you can collide with geometry instead of collide with solids. To do that, you need to put a tag into the .egg file under the tag, like this:

<Group> bottleOfMilk {
  <Collide> {Polyset keep descend}

You can find more information about this on the forums - be very careful when doing expensive collision tests like this.