- Home /
Model Hovers Over Terrain
I'm not entirely sure why this would start to happen, but my model has began to hover above the terrain. It has worked fine for ages, and after about 30 minutes of trouble shooting, everything seems to be fine. The only thing I did was remove a rigidbody attached to a completely different model. Considering everything appears to be in working order... any ideas?
Answer by syclamoth · Sep 27, 2011 at 03:49 AM
The answer to this problem is right there in the screenshot! Your capsule collider is somewhat larger than the character model. You need to tune it so that the bottom of the green capsule lines up properly with the character's feet! Alternatively (and this is what I always recommend for this kind of problem, regardless of how practical a solution it is), you should have a look at implementing the Unity Locomotion System- A fully functional character IK system for keeping your character's feet where they're supposed to go. It's especially useful for bumpy terrain, because it keeps the feet exactly on the surface they're supposed to be walking on. It requires a little setting up, and will change the way you program all your animation code (albeit by simplifying it somewhat), but is well worth the effort.
Hmm. I'm a bit crunched for time with this particular project. Although, I haven't changed anything so the set up should remain how it was(which was working perfectly). I can change that as many times as I want.. (and in fact I have) which means it's probably being changed back somehow . o_O
The problem isn't the character controller size at all. I created a video to show you what I mean, just fyi. I do need ideas on what could possibly cause this though. If I can't figure it out as a last resort I can start over from another project version but I'll lose alot of time o_O
Ok that's pretty weird. Have you checked your collision layers to make sure that those fist colliders aren't interfering with the other collider? Why is your character rotating like that at the start, is that deliberate? Try putting the actual animated mesh on a child object of the one with the colliders etc. Is it something to do with your animations having a reference pose that is different from where they are when they walk? I still recommend using the locomotion system, it's not that hard to learn!
I've checked every thing humanly possible. The only thing I can narrow it down to is a script error of some sort. Right now I am deleting all my scripts then I will import older versions of those scripts to see if that was the issue. Btw I did download that locomotion system, it sounds pretty cool so I'll give it a try.
Btw no the rotation wasn't intentional. One second it worked. I tried to "clean up" some code, and the next it "didn't" work. o_O I'm so annoyed because I had 6 files open and not a clue which one I editted last..
Answer by robrice · Mar 18, 2014 at 10:34 PM
I just had a similar problem with spheres. Now sure how/when but they began to appear to hover about .25 units above the ground while rolling. I found out that somewhere along the line I had changed the default sphere collider radius from .5 to 1. For some reason, this caused them to appear to hover .25 above the ground. When I changed the Sphere collider radius back to .5, the problem went a way. I can increase the size by using the transform scale instead.
Your answer
Follow this Question
Related Questions
Hovercar Script, object slowly descends instead 0 Answers
stop rotation when mouse cursor hovers over model 1 Answer
Hovering trees and grass 0 Answers
make character hover in correlation with parameter 1 Answer
Hovercar-like movement? 1 Answer