【Ground Fitter (free)】- Fit your dynamic objects to ground

Ground Fitter is component which is dynamically fitting object to ground.

You can choose if you want fit object in X and Z rotation axis (good for spiders) or only X (human/quadropeds etc.)

Thanks to generated additional transform you have clear control over Y axis rotation and can use transform.forward to move in desired direction.

> Link To Asset Store <

5 Likes

Hello,

first of all: thanks a lot for this free asset, which sounds extremly interesting!

I am trying this on my 4-foot animals.

First test subject is my cow.

I tried with the Standard values, and see no Change. My landscape has 45° slopes or plain Ground, on the Slops I expect the “front feet” to be a bit more upwards or downwards now? But it Looks like before, no Change.

So I set values to be more fast (Speed), removed the “match side Rotation” and set the “raycast height Offset” to the character controller height.

Still Nothing happens. The Colliders are Standard layers, no Change here.

Any idea what am I missing?

Thanks!

1 Like

PS: Height Offset on 0.15 also see no change.

PPS: It has something to do with the Ground layer I guess. I have no Special Ground layer.

// If cast catch ground
if (LastRaycast.transform)

here never Returns true. I will examine my layers. I guess in the readme a short hint and a sample would be helpful?

Anbd the Groundlayer mask could be a good idea to be in the inpector like the other public variables?

Thanks.

Hello,

me again, got it working now (I just completly removed all groundlayermask stuff from the code).

Some improvement ideas maybe:

Maybe a public bool use LayerMask? If not just ignore all of it. Works good for me.

One Problem: if a cow goes down 45° sometimes it jumps between I guess 30° and 60° Degrees multiple times a secone. That’s a Problem, I try with slower Speed again.

One Suggestion: If my cow runs down or up 45° it sometimes looks strange. And in real life, it could not do that, but in my Chunk-Landscape (like minecraft but with 45° slopes instead of 1 meter high single blocks in the landscape) it Needs to be this way. Maybe a maximum Rotation could help? Like it is running 45° upwards, but only rotates 30° upwards (and same for downwards) so it is a bit wrong, but still Looks better on the cow?

PS: With Speed 6 again sometimes it works climing 45°, sometimes it jumps between 30° and 60°, this way it is unusable! Maybe if you like to improve it, just do a little demo scene with some plain areas and some 45° slopes between one and three meters long. And very small slope changes or small obstacles should be ignored, too, maybe with a public parameter like “Ignore changes smaller than X”…

Just some suggestions / ideas.

Thanks a lot! I will test it on other animals now :slight_smile:
I also have a big crokodile! Which should be the worst Scenario :stuck_out_tongue: But it would be really good if it worked for Standard animals like cows, sheep, wolfs etc.

1 Like

Hi! Thanks, I wrote line about layer mask in readme but I assume very few people will read this :smile:
I currently made layer masks in public value, this is the way I should done it at first place, but I must wait for update approval.

I have in plans enchance this package with more features, but feel free to suggest, I will put it in my task list for package :slight_smile:

1 Like

Thanks a lot!

If you add something like a minimum angle or height to be ignored, or a maximum rotation angle, that would be great!

I would like to beta-test, I have around 30 different animals :slight_smile:
Feel free to send me the updated script if you like Feedback! Thanks again.

Hello,

the two animals in the sample are using rays. Is there already a possibility to detect if they are Standing a front of the wall? Like no Rotation needed, but cannot move Forward anymore because of a wall and not a slope?

I am having problems to detect a wall, which is not only a slope but really a wall…

Thanks a lot!

Hey, sorry for late reply but I was on holidays :wink:
You can use raycast or collider :wink:
I planning add in some update controller for movement like in this video (just translation, no animation)

https://www.youtube.com/watch?v=t_DCyIWcRDo

Version 1.1 released!

  • Fully controllable rotation limits with some new extra options
  • Demo scene with third person movement using ground fitter and toggle to use physics (experimental)

> Link To Asset Store <

1 Like

That Looks extremly interesting! I will try that :slight_smile: Thanks

Hello,

I just downloaded your lateast Version and I am playing around with values for my cows. To add other animals later if it works…

The Ground height seems to be okay and if they walk Downhill it looks good.

But they never walk uphill! I also tried with look ahead 0.5 but still nothing. They still play the Walking Animation but do not move anymore, if there is an uphill before them, in my case These are between 30 and 60 Degrees, think of a much simpler landscape…

How do I get them to walk uphill, too? Is the value for raycast height Offset okay compared to the character Controller y Offset? Thanks a lot :slight_smile:

Enter on variables (not in playmode) to see tooltip for variables, maybe they will guide you.
You can try use raycast height offset, then raycast wil be casted from little higher point.
Also when you have long animals like cows, consider using look head raycast and ahead blend - it will make another cast a little at front from origin position of your transform and make like average of this two rotations.

I don’t know how this stuff will work with character component - also character component.Move() method is kinda expensive when you use more than 30 of them.
You can send me project with your terrain and one animal then I would check what’s going on, hard to tell right now.

The source code of my Project is around 12 gb :slight_smile:
But Maybe I could make a Little sample with just the cows (or a replacement for them) with the character Controller or my landscape which has 45° slopes could be causing this problem…

One question: Could the scripts in this asset be used to detect a hole in the landscape to stop and turn around or a wall / obstacle to stop and turn around?

I still have huge Problems with my animal “wander” ai and monster follow ai and I bought “ICEcreature” a year ago but I never got it Working and now it is officially not supported anymore (and before there was no real Support).

Thanks :slight_smile:

1 Like

I would need only animal mesh and terrain :wink:
Scripts in this asset are only for fitting purpose, you can check Nav Meshes for that stuff or do it other way, probaby there are tutorials for such AI on youtube :wink:

Yes there are plenty navmesh tutorials, but not much without navmesh.
I have a complete procedural randomized landscape without waypoints etc and I want my animals just to wander around and flee if Player attacks them, and Monsters to follow Player on sight.

Already works pretty well with my own script until there is a hole or a obstacle / wall :slight_smile:

I you add that stuff and make a working asset for 10-20 bucks I will be the 1st one who is buying :smile:

That’s nice idea :slight_smile: I could make shepherd game example, but first I must make some other things done, which can take few weeks.

Sounds great. My animals and Monsters drive me nuts, and I don’t want to Add waypoints or navmeshes and this would be diffilcult in my case :slight_smile:

The groundfitter would be a great Option! And I guess for others navmeshes could also be great Option, but for me it is just wander, flee from Other object, follow Other object and avoid holes and obstacles and straight walls…

I will make a sample Scene with my landscape.
I guess it would be okay to include some animals which do not belong to me, I bought them from here?

Or I can Add something else that is not on the store or Maybe from your sample…

I am open for beta-testing lol :slight_smile:

Oh if you using models from protofactor you don’t need to add them, I know how they models works with axes, that was the reason why I wanted them for debugging.
So you can send me only landscape with your gameobject with groundfitter, empty inside (without model).

I will. Thanks for your interest, Help and the groundfitter asset (for now) :slight_smile:

I will create a sample Maybe today after work or tomorrow.
If you want to have a look how the landscape Looks like you can see it here: