Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
18
Question by SisterKy · Jul 24, 2011 at 03:01 AM · collisioncharactercontrollerfallingfalling-through-flooroafa

Checklist: Object or Character is falling through the floor

This has been answered a gazillion times, but I found that all possible answers are spread across several Questions... So we should have a reference-list of possible reasons.

Greetz, Ky.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image 99thmonkey · Dec 08, 2012 at 04:10 AM 0
Share

Thank you so much! $$anonymous$$y flying/swim$$anonymous$$g object kept falling through the ground/terrain. The issue was I was using transform.Translate. Now I'm using the below! Works like a charm (too slow, but works)! Now I just have to fix my acceleration so it that the controller doesn't move if I'm holding my tablet vertical. :)

Thanks!

var move:Vector3=Vector3.zero; move=Vector3(Input.acceleration.x*2,Input.acceleration.y+up,-Input.acceleration.z); controller.$$anonymous$$ove(move*Time.deltaTime);

12 Replies

· Add your reply
  • Sort: 
avatar image
39
Best Answer Wiki

Answer by SisterKy · Jul 24, 2011 at 03:03 AM

Check each Object involved (FallingObjects and GroundObjects)

  • does Object have a Collider? If not,
    select Object
    > go to the top bar
    > components
    > physics
    > choose appropriate collider
    (if Terrain, check the last tab, the little cog-wheel)

Note: mesh-collider may cause problems
Particularly, if both FallingObject and GroundObject have mesh-collider
Particularly, if the mesh is animated
To avoid mesh-collider, you can build an aproximate shape of your mesh from several primitive colliders (in parent-, child- or sibling-GameObjects)
If you need a Mesh-collider no matter what, you can try to place additional primitive colliders where they won't be in the way to 'enforce' the collisions

  • is the Object a Trigger? If so,
    select Object
    > find its Collider-Component (if Terrain, check the last tab, the little cog-wheel)
    > remove the check of 'IsTrigger'

  • is the Collider placed well?
    fiddle with center, size and skin-width (start with 0.1) until the green outline aproximately fits the character
    (If you get really strange values, it might be due to scale (e.g. your mesh was way too big so you downsized to .01))

  • you may try to zero out all positioning (both unity and your modeling-program)

    FallingObject and GroundObject have a problem with each-other

  • FallingObject-Collider and GroundObject-Collider intersect each other
    Move the Object much above the ground (have it fall from some considerable hight for test-purposes)
    All of it! Not just the collider or something else that is attached to it (e.g. the Camera of a Character Controller)

Note: a poking-through ["grey capsule"?] may cause Problems even if it's disabled
[I am not sure what that means myself, I'm sorry... the answer that posted this solution was not very specific =/ ]

Imported Objects (.obj, .fbx, .max etc.):

  • Before dragging Object into the Scene (delete if already there)
    Look at the hierarchy
    > find the model
    > properties
    > check 'Generate Colliders'
    > hit Apply
    > now drag to the scene

  • Are the Normals correct? You may have to
    go back to your modeling-programm
    > hit flip/reverse Normals

  • Is the Mesh clean?
    Reportedly a single 2-vertex-"triangle" caused bad collider-issues

  • Geometry is rather complex? Then you need the Mesh-Collider set to convex
    Select Object,
    > Mesh-Collider-Component
    > check 'IsConvex'

    FallingObject has a Character-Controller:

  • is a Rigidbody applied? If not,
    select FallingObject
    > Top bar
    > components
    > physics
    > rigidbody

  • is Gravity applied? If not,
    select FallingObject
    > find its Rigidbody-Component
    > check 'Gravity'

  • and has a MouseOrbit?
    Make sure MouseOrbit never has/picks up any parent of the respective object that MouseOrbit is attached to (usually the Camera) as MouseOrbit-target or the resulting 'dog-chases-tail'-scenario will cause falling.
    http://answers.unity3d.com/questions/161386/third-person-controller-falls-through-terrain-upon.html

    GroundObject is a Terrain:

  • rumor has it, that Terrain Collider may be screwed up by using the terrain toolkit asset package to make the terrain.

  • collisionmatrix may cause trouble
    go to Edit
    > Project Settings
    > Physics
    > collisionmatrix

    Scripts

  • FallingObject has a script with 'transform.Translate' or 'transform.position = ' or various other 'funky' scripting
    This may push the Object through the collider 'against its will'. Try to avoid it. (e.g. use 'velocity' or try SimpleMove)

    Keep your scene clean

    • especially the mac-version seems to be a bit buggy when faced with too much superfluous crap. may somehow disable all colliders.

      Debug

    • Increase physics calculations per Frame
      try and catch collider penetrations (this doesn't solve the source of the problem)

    • drop the Character and a default Cube from high up
      If both fall through, investigate the floor's properties.
      If only the character does, investigate the player's properties.

    • sometimes good old restart or reimport might just do the trick...

    • You may want to try Debug.Log(colliderFlag); to check, if it's really not touching.
      http://unity3d.com/support/documentation/ScriptReference/CollisionFlags.Below.html

      Note

    • falling occures when minimizing or alt-tabbing the editor
      This is a known issue; don't worry about it too much, it's only in the Editor and won't happen in the final-built game.

Please Note: I have no competence on the matter what so ever... just gathered what I found. So please point it out if you find any (severe?!) mistakes.

my sources:

  • http://answers.unity3d.com/questions/39789/tornadotwinswormvideo2-help.html

  • http://answers.unity3d.com/questions/17779/character-model-sinks-through-floor.html

  • http://answers.unity3d.com/questions/31397/object-falls-through-floor.html

  • http://answers.unity3d.com/questions/31033/items-falling-through-floor.html

  • http://answers.unity3d.com/questions/29719/falling-through-the-floor-issue.html

  • http://answers.unity3d.com/questions/43206/falling-through-floor.html

  • http://answers.unity3d.com/questions/35010/my-object-falls-through-terrain.html

  • http://answers.unity3d.com/questions/8369/whenever-i-run-my-game-i-fall-through-any-terrain.html

  • http://answers.unity3d.com/questions/21021/enemies-fall-through-floor-when-chasing-player.html

  • http://answers.unity3d.com/questions/17221/char-is-falling-through-the-terrain-when-alt-tabbi.html

  • http://answers.unity3d.com/questions/63750/my-characters-and-rigidbodys-fall-on-my-new-terrai.html

  • http://answers.unity3d.com/questions/57077/character-collider-physics-bug-in-unity-33-falling.html

  • http://forum.unity3d.com/threads/38996-first-person-controller-falls-through-the-terrain

Comment
Add comment · Show 10 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Zorcian · Sep 03, 2011 at 01:27 AM 1
Share

A more detailed explaination can't be given good luck

avatar image Zorcian · Sep 03, 2011 at 01:27 AM 1
Share

A more detailed explaination can't be given good luck

avatar image Zorcian · Sep 03, 2011 at 01:27 AM 1
Share

A more detailed explaination can't be given good luck

avatar image Zorcian · Sep 03, 2011 at 01:27 AM 1
Share

A more detailed explaination can't be given good luck

avatar image Zorcian · Sep 03, 2011 at 02:00 AM 1
Share

A more detailed explaination can't be given good luck

Show more comments
avatar image
2

Answer by ivanjm81 · Aug 14, 2011 at 08:01 PM

After a lot of pain and headaches, I've got another addition for the list.

I have a lot of moving and rotating platforms (via iTween) in my project. These were static colliders (they didn't have a rigid body attached). After lots of research, I've found this thread, where it's recommended to attach a kinematic rigid body to a static collider wich is going to be moved a lot (in order to improve PhysX efficiency). So I attached kinematic rigid bodies to every moving or rotating platforms in my scene.

Worked for me!!!

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Jela · Jul 12, 2014 at 01:18 PM 0
Share

I have a question regarding this.. I have a cube (it is an imported fbx file from blender) , there is where I placed the character. The Character controller has already a Capsule Collider and Rigidbody. It uses Gravity and Is trigger is not checked. The constraints of the character is In freeze rotation (x,y,z). While the cube, it has Rigidbody, $$anonymous$$esh collider. The is Trigger is unchecked and the convex is checked. On it's prefab, generate colliders is checked. Why is it the character keeps on falling? :(

avatar image
2

Answer by Simple-Blue · Jan 21, 2017 at 09:16 AM

HIGHLY OVERLOOKED RESOLUTION

Add this to the list

Under the component Rigidbody:

   Collision Detection -> Continuous Dynamic

Please note this is more resource intensive, but is much less likely for collision to occur. This is issue commonly missed in answer forums on collision.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image vkmicro · May 17, 2018 at 09:17 PM 0
Share

Thank you very much! this was the fix that worked for me! No more falling through the floor! yay!!!

avatar image
0

Answer by intrepidis · Nov 13, 2014 at 10:58 PM

As an alternative to using a mesh collider, it is possible to use the much faster sphere collider. Just put many differently sized sphere colliders throughout the mesh area. Here is a complete example of how to do this:

http://isg.cs.tcd.ie/spheretree/

The source code can be downloaded at the bottom of the page. I would recommend fully reading the article first though.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by $$anonymous$$ · Nov 14, 2014 at 06:15 PM

i had this problem once, the problem was that i accidentally put a mask on the Base Layer, making my character to fall through the ground.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • 3
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Problem with character controller and collisions 1 Answer

Collision CharacterController vs CharacterController 2 Answers

NPCs fall through hills in terrain 1 Answer

How can I make two Character Controllers Collide 2 Answers

Collider not continuing to Ignore CharacterController after center changes. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges