Jump to content

[Solved kind of :)] My feet's does not touch the ground sometimes


Roland
 Share

Recommended Posts

Well.. actually my feet's are on the ground, but my game character has that problem.

Walking on flat terrain is no big problem, but when she enters hills and rough terrain her feet's floats above the ground. I guess that is cause by some collision mesh thing and is hard to avoid.

 

 

 

Above she is standing on a slope. (left image with Debug Physics on).

I guess make the diameter of the collision cylinder would make the problem less prominent, but is that the only way to go without writing your own controller.

 

How do you guys solve this or at least minimize the problem?

Roland Strålberg
Website: https://rstralberg.com

Link to comment
Share on other sites

I don't know the how everyone else would do it in the industry, however this is how I would do it:

 

1. Shoot a ray-cast from both the left and right foot bones directly vertical

 

2. If if either ray hits something at a distance greater than X (you decide was x is.... close to 0 I'd say),

- adjust the model offset from the model to the controller by moving the model down by the amount of the longest raycast.

- Move the foot bone with the shortest raycase distance up by whatever that distance was.

 

Ensure that if the raycast length difference between the left and right are no greater than Y otherwise it will look silly.... In this case the character should probably fall down the hill or slide down it or somthing.

 

This should give the effect of your character adjusting their footing while on hills. I've seen this done a lot in 3rd persons and this is just my way of understanding it.

 

To edit animations manually in run time by moving bones check out this short little tutorial of mine that I did a while ago:

- http://www.leadwerks.com/werkspace/page/articles/_/programming/character-animation-tricks-tutorial-r83

STS - Scarlet Thread Studios

AKA: Engineer Ken

 

Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now!

Link to comment
Share on other sites

Your cylinder is way too wide for the character. Make the cylinder as narraow as the characters body. To prevent that arms go trough walls, animate them to raise arms when close to a wall, that's how crysis does it also when the weapon is too close to the wall.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Yeah, this is where we really need 'Foot Placement' and IK. It gets quite complicated to get it looking even semi realistic for most situations! Chris Paulson did some nice work on this.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Roland, capsule will not make any serious difference. With capsule, you may eventually end up that some parts of your character (feet) cutting inside terrain, so its not a solution..best way is along lines Scarlet Thread Studios suggested, but if that is too much, just simply make radius of controller to wrap character mesh very tight..its common thing and you may see that a lot of games have slight 'floating' characters. Typical example is Tomb Raider..unless some serious accuracy is a factor, either capsule or cylinder will do well, and instead, it has to be some custom made system..

 

Link to comment
Share on other sites

Roland, capsule will not make any serious difference. With capsule, you may eventually end up that some parts of your character (feet) cutting inside terrain, so its not a solution..best way is along lines Scarlet Thread Studios suggested, but if that is too much, just simply make radius of controller to wrap character mesh very tight..its common thing and you may see that a lot of games have slight 'floating' characters. Typical example is Tomb Raider..unless some serious accuracy is a factor, either capsule or cylinder will do well, and instead, it has to be some custom made system..

Naugthy. I trust in your experience. Think I will try to reduce the cylinder diameter a bit and go with that. Later on I will have to dive into code manipulated movement of limbs anyway (some simple IK for moving the hand to pick up things), so I will test Scarlets suggestion at that point.

 

Thank's guys

You are great.

Roland Strålberg
Website: https://rstralberg.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...