Humanoid physics advice

Hello my fellow BGE artists.

I have come here today for physics advising for a humanoid player character in BGE.

All logic is applied to the rig and the camera (it’s FPS so there is mouse look on camera and such). This is my current physics setup for the player character:

Rig = Character with all defaults.
Model = Static, actor and host checked, collision bounds checked with convex hull at 0 radius.
Widget (came with rigify rig) = Static ghost.
Camera = Static ghost.

All other things in the scene are static defaults.

The problem I am having is that the model/rig is still colliding with things way outside of the convex hull collision zone of the model, leaving me to believe that it is in fact the collision zone of the rig that is causing this problem. I tried to shrink the root of the armature to make it small, then again tried but still I am colliding somehow. The collision is definitely not the floor, as I tried with an open plane and have no problems, it is just the other static objects in the room.

So my Q is, what can I do to improve the physics of my model? Keep in mind, this is a pretty realistically proportioned, scaled, and modeled human.

I was thinking maybe I would have to chop my body parts off and establish a different collision zone for each of them, probs a cylinder or something, rather than using the convex hull option for the entire body. This however would not solve the issue if it was the rig causing the problems.

Thanks all,
-KB

Hi I hope you are having a good day.

Set the characters physics type to No collision and then parent hit boxes to each body part.
e.g. you place a mesh that has approximately the same size and shape of the arm over the arm in such a way that there’s an arm in an arm then parent that mesh to the arm’s armature and set its physics type to Dynamic or Static.
I recommend reading “Professor Monster’s Guide to character setup”

I hope this helps

Okay I am going to bump this for clarification. That guide is awesome, but I am still wondering about the physics body. I understand the purpose of creating a physics body, but I am a little confused on the parenting of it. In the image below, I show you all the physics body I have made for my model:


What I am confused about is the parenting. I believe now I add all motion and movement and such to the physics body, then parent it to the armature. But then for animations, like walking, the legs would no long be in position with the physics box. Would I need to animate the physics box along with all of the armature animations in order to maintain some sort of box at all times?

Or am I tots missing something here?

Thanks,
-KB

Hi I Hope you are having a good day.

As far as I know you cannot use a solid mesh as your physics object,
because armature deformed meshes influence the visual but not the physics representation of the mesh object.
Due to the above problem you will have to bone parent separate invisible meshes to the armature of the body part of which you require collision.
See the image below.

-The black paint represents the character (Skin mesh i.e. what the player sees).
-The blue represents the armature object.
-The green represents collision (physics object) object which is bone parented to its respective bone.
i.e. mesh A will be parented to bone A of the armature.
Note the hands collision object will look like the hands only a little bigger same for the head, legs etc.
Apologies I am not very good at MS Paint.

I Hope this helps

Attachments


Hm, but it still does not answer the question for me though sorry.

I am saying if the physics mesh is parented to the armature, it won’t move in the animations that the armature performs. So then we have to animation the physics meshes to match the armature animations? Otherwise the arms, for example, wouldn’t have a physics collision box if they are outreached to aim with a weapon.

And yeah, the body wouldn’t be solid in run time, I would have it switched to wireframe. If it is not one full body mesh though, wouldn’t that leave holes where the body would have no collision?

Thanks for help so far and such
-KB

adwitandrew is giving you the right idea if im understanding the problem correctly. Make sure your parenting the collision boxes to bones so they dont distort to much. Ill try this pic


The “collision” cube will be parented to the forarm bone. Moving with the armature you can detect collisions on the cube and manipulate it as nessecary. Youll need some python to do this. I can pick up whatever that box collides with as it moves with the forearm bone. I just say parent your collision boxes to your bones rather than the mesh. Is this even what your talking about??

Hi I Hope you are having a good day.

Yes, You will have animate the physics mesh to match the armature animations.
Yes, It probably will have a few tiny holes depending on how you model the physics object, but these
are often to tiny to cause any noticeable problems
The process is as follows:

  1. model the character.
  2. Using the character mesh as a point reference model the physics mesh.
  3. Construct the armature object.
  4. Parent the character mesh to the armature (Preferably using the “With Automatic Weights” option).
  5. Put the physics/collision objects in place.
  6. Parent the physics objects to their respective bones e.g. the lower arm’s physics object to the lower arm’s bone (Using the “Bone” option).
  7. Animate
    Remember: character mesh’s physics type = “No collision”.
    physics object physic type = “Dynamic”.

See example Blend Below.

I Hope this Helps.

Attachments

example.zip (436 KB)

Okay I see now, thanks.

I was misunderstanding initially, I though we parented the armature to the physics mesh. I see now the correct method, thanks for the help!

You are well come.