animation effected by environment

Hi,

as the title say “animation effected by environment” any example especial at wall grab if character near at an wall
like in tomb rider 2014 or some horror games.

what about ledge hing (grab ledge if in near/range)

solving that with some bone constrains?

thanks for every methods or example

no one has an solution for that?

Typically you detect a certain condition and play the according animation. That is nothing fancy. It might get a lot of combinations but with some smart assumptions you can reduce it a lot.

Example - climbing:

You assume the “grab” is always at the same location. You only allow start climbing when the character is at a certain location and faces a certain direction. This way you just play the start climbing animation followed by the climbing animation.

Especially on user controlled characters that can be hard to pass that condition. So you can implement some sort of help. E.g. when the character is near a ladder and the user request climbing (e.g. via a key press), the character performs a “prepare climbing”. This can be automatically walk to the climb location and turn to the climb direction.

This way the start climbing can begin after the prepare climbing operation.

the order is:

near climbing area + climbing requested -> prepare climbing -> start climbing -> climbing …

Each step has it’s own animations and operations, but it will work with a lot of ladders :D.

This works with many other tasks as well e.g. grabbing things, opening doors …

see how the monster is grabbing things (0:19; 0:33) or using things (0:40).

I was thinking about an wall <-- the Player is “near” and walking along the wall the player holds the hand on the wall while the walking animation is execute.

I was thinking about an arm has an IK bone constrain and if touching the wall the arm will automatically get bend to the right target with the correct distance

you need to use rayCast function to guide your IK constraints to the nearest object in range, just a few lines of python

Isn’t it more effective to let the character walk a predefined path that matches the walk_and_hold animation? This way the animation looks plausible.

The opposite alternative is to perform calculated animations similar to rag-dolls. I think BluePrintRandom was aiming for such systems. It can help on placing feeds on steps with different heights.

Somewhere in-between would indeed be an IK-Constraint.

any example?

mh, for an simple cave, maybe.
but not for an more wide open terrain where the player can run against the wall and walk along them “free”, it wouldn’t fit well.

is this like the rayCast function guramarx is telling about?

I think I have to ask him about that