Search Unity

Rigidbodies sometimes passing through each other in my simple coin pusher

Discussion in 'Physics' started by panicsteve, Oct 27, 2015.

  1. panicsteve

    panicsteve

    Joined:
    Nov 18, 2014
    Posts:
    3
    Hi there!

    New to Unity. I have been working on a simple "coin pusher" type game to get the feel of everything.

    It's working pretty well, but sometimes the coins land in such a way that the "pusher" just goes right through them, until they get "bumped" by another coin and the physics objects get tweaked just enough that it starts working again.

    I'm not sure how to fix this!

    You can see a stuck coin in this video:

    http://stevenf.com/gfx/unity/coin-pusher.mp4

    And here's how the scene is laid out:

    http://stevenf.com/gfx/unity/coin-pusher.png

    The pusher block and the surrounding structure have box colliders that are the same size as their volumes.

    The coins are flat cylinders with mesh colliders, and have rigidbodies. They spawn with a random rotation and slightly randomized placement.

    Thanks for any advice!
     

    Attached Files:

  2. panicsteve

    panicsteve

    Joined:
    Nov 18, 2014
    Posts:
    3
    OK, I think I might have just solved my own problem...

    The "pusher" did not have a rigidbody attached to it, so I added one. Then the coins hilariously pushed it off the back of the world.

    Then I set the "Is Kinematic" flag on it, since it's being driven by a script.

    Now.. things seem to be OK? Anything else I might have missed?