How do you code footplanting?

Hello,

So I’m making a battle royale game so I thought it would be a cool feature to add foot planting to make the clientside gameplay seem more realistic in 3rd person. But there is a slight problem as well. How do you code foot planting whilst making it compatible with mo-cap animations? My scripter has made a smooth weapons framework which looks amazing but this added feature would be great 3rd person feature to add. Any support or help would be greatly appreciated!

Thanks.

Current framework right now - EXILE FRAMEWORK 1.0

6 Likes

Dev advice: don’t do leg planting.

You need IK and a basic understanding of the walk cycle to do it. It takes a lot of time to look good and even then it doesn’t look good in every situation. I highly recommend you try it once the game is done.

16 Likes

You can add keyframe names to your mocap animations to mark where the “plants” are to play sounds and what not. As far as adding any kind of collision to the foot goes you’ll need to have a decent understanding of IK like @ScriptOn said.

The basic idea for mixing it in with mocap or keyframed animations is you’re going to raycast the leg skeleton from the hip to the knee to the foot and reorient the leg to have the foot “collide” with whatever is found. It largely depends on your animations but you should be able to get decent results by just editing the rotation of the leg joints.

In AR2 I fake the directional bits of foot planting but just blending between a set of animations. Our animator did different strafing and walking animations for the 8 directions WASD gives you and I play the closest one movement direction. We don’t do any kind of collision but the added directional animations feel really good and it makes up for the lack of actual foot planting.

5 Likes

I tried to make some actual physically based IK walk cycles at this place. It’s uncopylocked, so if you are interested in what would be involved in IK stuff you can take a look:

It was really hard, like, much harder than I expected. I think that if I did it with my current programming knowledge I might be able to pull it off to a satisfying level but I’m not even sure of that.

8 Likes

What WhoBloxedWho said, just label keyframes and use the KeyframeReached event.

1 Like

I’ve made a thread on this and got help from WhoBloxedWho. It is much easier to make than I initially though, took me like 1-2 days, it’s not perfect but for me it is good enough

1 Like

Thanks! I’ll definitely forward this to my programmer and I’ll post the results.