best way to make a character crouch in 3rd person

we are working on a character that needs to crouch and we already tried several ways to do this.
we are quite tired of the problems it gives, no physics update until movement, scaling that doesn’t scale correctly.

are there some examples how to do a correct crouch for a third person game?

Check the resource forum, search this forum. This topic comes up from time to time.

sadly almost none of the questions are solved…:no:
we are using simple box collider

crouch button -------------and-----------------Armature Action & Collision Box Action

The first action plays your characters crouch
The second plays the animation where you collision box’ size is modified. if you need help on how to do the second thing check thisout. (note he basically just uses key frames to change the size of the box)

Alternatively to the action on the collider you could replace its physics mesh with one that fits your crouching player.

we have tried the animation system, but for some reason the replace mesh actuator will not work…
I have tried it with a scaling already but the issue there is that it suddenly scales to the middle, and bullet doesn’t update until I move the character… what I mean is that after the scaling the collision box in the physics visualization doesn’t see itself floating… it even goes to sleep in the air…:confused:

You probably should enable “No Sleeping” in your physics mesh on your character. You could also use a Convex Hull type of collision bounds, which will update according to the mesh’s vertices and dimensions, rather than updating around the center of the mesh like the built-in collision modes (box, sphere, cylinder, etc).

here, I will make a physical object, that changes bounds while ducking, one moment,

Ta da!

4.5 minutes later :smiley:

Attachments

CrouchCode.blend (444 KB)

Here’s a different technique.

I’ve since found it works well only with unique characters, so if you have a lot of characters sharing the same armature and mesh it won’t work. But for a main character it should be fine. It’ll give very accurate hit detection, even allowing per body part hits.

Alternatively If you are using a box, make sure it’s a ghost parented to the main movement object. That won’t work well for crouching to go under obstacles but I don’t know any good techniques for that.

Smoking mirror, download my file :smiley:

it works great, and you can scale non cube items this way as well,


Hey guys, some posts earlier I wrote that it was possible to do that task by replacing the physics mesh, but while testing this with multiple objects that share meshes I noticed that replacing the physics mesh on one of them will actually change it for all. Changing the graphics mesh will only have effect on one object which is the result I would have expected. Is this a bug or supposed to be like that?