Search Unity

mesh collider and player falling through it..

Discussion in 'Editor & General Support' started by boxy, Aug 14, 2005.

  1. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Hello
    I have a tower and a terrain both with mesh colliders. My fps player seems to be able to run around them fine and collisions seem fine sometimes, and then other times the player unexpectedly walks through a wall or falls through the terrain (after a jump or some such like). Is there a setting I'm missing to make sure this doesn't happen?
    Thanks
    Boxy
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    Hmm. Can you post a screenshot of your setup.

    Select all colliders and the player before making the screenshot.
     
  3. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Thanks for the reply
    Here's a screenshot with the 3 inspectors superimposed. Also project setings/physics.
    I have no ide whether I am supposed to be doing anything special to prepare the imported meshes but these are coming in as 3ds exports from Cinema 4D
    Thanks for your help.
    Boxy


     
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    On which part of the mesh does it fall through?
     
  5. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    The tower also has inside walls (with normals facing inwards), there's a room about where the camera is, from the inside, the player can run at the wall and go straight through it to the outside. Also sometimes if the player jumps from the tower level cliff to the lower cliff where the cave mouth is, it goes through the mesh. I haven't really established a definite pattern yet, it just seems to happen sometimes. Sorry I can't be more technical :) I just wondered if that was a known thing and there were collision settings to tweak in order to stop it.
    Cheers
    Boxy
     
  6. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    The only thing i could think of is, when you have a surface with two sides with opposite normals very close to each other.

    Like a very thin box.
    You could try moving the two sides further apart in this case.
     
  7. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Ok I'll try that, thanks a lot
    Boxy
     
  8. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Hello again
    I've moved it some and the problem persists. I have noticed that it only happens when I run at the wall full speed (I have the player set up to run fast). If I approach it more slowly the collision takes places. Is this significant to anything?
    Thanks again
    Boxy
     
  9. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    I could send you the .3DS scene if that'll help? there are no textures yet so its only about 400k, then you could set up an fps capsule to the same scale as the little low poly man in the scene and it'll be the set up I have so far. Sorry to be a nuisance :)
    Thanks
    Boxy
     
  10. Richard_B

    Richard_B

    Joined:
    Jul 22, 2005
    Posts:
    436
    I have seen this sort of thing with the FPSWalker script. If the velocity is set too large, then the player will zoom through walls. One thing that sometimes helps is to decrease the "Fixed Time Step" (Edit->Project Settings > Time), or do something that decreases the largest velocity the player gets to (decrease gravity in you case?).

    cheers,
    Richard.
     
  11. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Thanks Richard. reducing the fps ground speed did seem to help but then it didn't :)
    I think I'll just start the scene again and see what gives...
    Boxy
     
  12. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Hi guys
    Well I tried re-using these assets but building a nw scene and the problem does indeed seem to be linked to the FPS settings as when they are at the default numbers collision works fine. Problem is that at the default settings the player moves way too sluggishly so - what to do next?
    Might the scale of the objects in a scene have any significance?
    Cheers
    Boxy
     
  13. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    Try changing 'Fixed Timestep' from 0.02 to 0.01 in Edit->Project Settings->Time.

    Or use a larger collider for the player?
     
  14. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    Odd I did try that last night after Richard's suggestion with no success but in the new scene it seems to have improved things, so I can only conclude that as a noob I messed with some setting or other that I forgot to put back :)
    I still get a flash of whats through the other side of the double wall if I run at it but it doesn't pass through. I'll go look in the manual and see what fixed timestep actually does :)
    Thanks for all your helps.
    Boxy
     
  15. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    OK now I feel silly as only a noob can! So just in case any other beginners run into the same problem - I could see the other side of a wall when I ran at it because the camera attached to my player capsule was further forward than the capsule's collider. :roll:
    ho hum, all part of the learning process I guess.
    Cheers
    Boxy
     
  16. Richard_B

    Richard_B

    Joined:
    Jul 22, 2005
    Posts:
    436
    One that got me for a while: I was trying to get a Mouse over script to work and the object I wanted to register the mouse over event just wouldn't. It took me some time to realise that the camera had slipped down ino the capsule!. You couldn't see the capsule because the normals were pointing away from the camera, but it was stopping the mouse over event from registering - doh!

    Richard.
     
  17. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    hehe, I'm sure I'll have many other such stupidities along the way
    Cheers
     
  18. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    I get them as well... It is even worse for me because I always get out the unity sources and begin to hunt for the bug there...

    One hour later, I return to Unity and see the setup error. DOH!
     
  19. boxy

    boxy

    Joined:
    Aug 10, 2005
    Posts:
    675
    then there is hope for us all, thanks heavens I don't have the choice of having to sift through source :)
    Cheers
    Boxy