Walking Lego-Model

Hello everyone!

I’m trying to create a FPS game(First Person Shooter) with Lego-Models. At the moment I’m trying to let my Lego-man-model walk on a staticPhysicsNode. But there is something strange. When i set my model on the staticPhysicsNode, he falls partly through it! I use generatePhysicsGeomitry(true) to generate the geometries. 

Here are some pictures:

I use an Animated MD5 Model with bones. In that animation, my Lego-man is doing a walkcycle.

PS:Sorry for my bad English

Can you turn on physics debugging so we could see the collision geometry?

maybe its the material setting, some materials like sponge, can intersect each other quite easely.

try to set a hard material like iron or granite and see if it still happens.

Thanks for the quick responses!

Eum, how do i turn on physics debugging? Is it ‘V’ when I run a physics program?(You can see the thumbnails larger when you click on it, and they are taken with V on…)

And my model had already the material Iron. But my staticNode not. If I set his material to Iron, and the legs of my Lego-man hit the ground, he flips away in the dark :stuck_out_tongue:

Yes, 'v' if your app class inherits from one of the standard classes. You can also set the variable "showphysics' to true. If you don't have that variable this you may not be extending one of the starter classes that has that built in.

For the material, I think they were referring to what the static floor's material was. If sponge, then it may bounce your lego guy a lot when he hits. Even if not sponge, you will bounce some with most materials, including the default (think dropping a bowling ball on concrete, it will bounce some).

Also, you guy looks to be not balanced correctly. The gun sticking out so far will probably topple him over. Just my guess though. I haven't used anything beyond simple primitive geometries for physics yet.

I'm not sure what the actual problem is, but:

  1. animation and physics do not mix really well - you need a workaround here
  2. even without animation you should not use triangle accurate collision if you can avoid it (don't use generatePhysicsGeomitry(true))

    So your best bet is to model the physics for your Lego model separately and use the loaded model as visual (animated) representation only. Physical model could be a simple box like in the tutorial. What do you think?