Search Unity

Character falling through the ground

Discussion in 'Editor & General Support' started by Hewlitt, Sep 7, 2012.

Thread Status:
Not open for further replies.
  1. Hewlitt

    Hewlitt

    Joined:
    Sep 7, 2012
    Posts:
    1
    I'm literally brand new to Unity, and I'm following tutorials, but the character I place just falls through the ground whenever I hit "play". It makes anything I do pointless as I lose control of the player immediately.
     
  2. Mauri

    Mauri

    Joined:
    Dec 9, 2010
    Posts:
    2,664
    Welcome to the Unity forums, Hewlitt :)

    Be sure that:
    - Your character has a collider attached
    - The ground has a box collider attached to it
    - Your character is stepping up a bit from the ground, meaning you need to place him a bit above the ground.
    (just pull him a bit up at the Y-axis)

    Such colliders can be applied by selecting the object you want and go to Component -> Physics at the top menue.


    I hope that helps :)
     
    ollietoby, KaemonIsland and Ambi_ like this.
  3. MarQuizE

    MarQuizE

    Joined:
    Apr 7, 2013
    Posts:
    2
    i have coliders applied to my terrain (terrain colider) and my character ( i got a box colider applied to it) he is launched from Y 100 and still falls through the terrain, i am a Flash game developer, Fireworks, Photoshop, Maya, Zbrush artist and want to try this program out, but it seems its very complicated right from the start... i am in a trial version trying it out and this program doesn't make the right impression from the start, lol, i mean since u drop ur character on the terrain the coliders should be applied automaticly really.. u should not waste time like this when developing a game, if anyone can find another solution to make a built in character work, which was supposed to work since its dropped on the terrain please do guys :))) i have patience :)
     
  4. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    No reason to resurrect two old thread that says the same thing. The answer given on this thread works for 99% of the people. If it doesn't work for you that is something else.

    To get the best support from the community a screenshot of your setup usually helps. There can be several reasons why your character falls through the ground. For one you can set up layers that makes your character ignore the terrain. Or you can make a script that moves the character using the wrong API calls or even call them incorrectly.

    If you want movement that is 100% under your control but still checked by the physics you should use the Rigidbody.MovePosition method called from the FixedUpdate method. The FixedUpdate gets called by Unity just like the Update but at a fixed interval that matches the physics simulation. If you just want to apply speeds in various situations and let the physics system figure it out on its own you can use Rigidbody.AddForce from everywhere. But what you cannot do is touch Transform.Position directly because then the physics system just sees the conflict and tries to resolve it without the knowledge of where you came from. And that often means you fall through the object.

    I hope this helps.
     
  5. spacemonkey11p

    spacemonkey11p

    Joined:
    Apr 11, 2021
    Posts:
    3
    NOT WORKING!!?!
     
  6. Jamesoo7

    Jamesoo7

    Joined:
    Feb 3, 2021
    Posts:
    1
    Be sure that:
    - RigidBody on character "not the same as collider"
    - Your character has a collider attached
    - The ground has a box collider attached to it
    - Your character is stepping up a bit from the ground, meaning you need to place him a bit above the ground.
    (just pull him a bit up at the Y-axis)
     
  7. Huddio

    Huddio

    Joined:
    Jan 16, 2023
    Posts:
    1
    No reason to reply to an old thread but if anyone new is looking is it Box Collider or Box Collider 2D? Only Box Collider 2D will work.
     
  8. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,627
    BoxCollider is a 3D collider. BoxCollider2D is a 2D collider. 3D colliders only work with other 3D colliders. 2D colliders only work with other 2D colliders.

    So if you're making a 2D game with 2D colliders for the environment then you'll need a 2D collider for your character too.
     
  9. maxy7809

    maxy7809

    Joined:
    Aug 2, 2023
    Posts:
    1
    I keep falling I tried everything
     
  10. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,674
    Please don't necro-post with uselessly vague comments.

    When you have an issue, start your own post... it's FREE!!

    How to report your problem productively in the Unity3D forums:

    http://plbm.com/?p=220

    This is the bare minimum of information to report:

    - what you want
    - what you tried
    - what you expected to happen
    - what actually happened, log output, variable values, and especially any errors you see
    - links to documentation you used to cross-check your work (CRITICAL!!!)

    The purpose of YOU providing links is to make our job easier, while simultaneously showing us that you actually put effort into the process. If you haven't put effort into finding the documentation, why should we bother putting effort into replying?

    Do not TALK about code without posting it. Do NOT retype code. Copy/paste and post code properly. ONLY post the relevant code, and then refer to it in your discussion. Do NOT post photographs of code.

    If you post a code snippet, ALWAYS USE CODE TAGS:

    How to use code tags: https://forum.unity.com/threads/using-code-tags-properly.143875/
     
Thread Status:
Not open for further replies.