- Home /
Mess collider issue
I am trying to catch apples in a basket and keep them there to see how many could be accumulated till the end of a round. I am using a mesh collider and instead of catching the apples, it holds them for only a moment if I'm not moving and then they fall through the bottom when I move. I'm not sure what to do in order to hold the apples(with the potential to drop them due to the games physics, out of the top, but that is beside the point). Does anyone know how to stop the apples from falling through the bottom, what might be causing this?
there are a few different options you can use for a collider. Which ones are you using? $$anonymous$$ight want to play with those options, if you haven't yet, to see if that helps. Also, since your using the physics engine so heavily, it might also be a good idea to move the basket with rigidbody.addforce(), rather than directly adjusting it's velcocity or position.
Answer by DanSuperGP · Jan 24, 2015 at 12:11 AM
How you are moving the basket is probably responsible for it. If you are changing it's transform, then you are in essence... teleporting the basket around rather than moving it.
Instead of changing the transform, use Rigidbody.MovePosition or RigidBody.MoveRotation. This will simulate the motion between you starting and ending positions rather than teleporting to the next position.
Answer by LessThanEpic · Jan 23, 2015 at 11:11 PM
There's a decent chance that if you're moving the basket too quickly the physics wont catch the collision (google unity fast moving colliders to read more about the problems there). Have you tried parenting the apples to the basket once they've been caught?
I want there to be a potential to lose them. The basket swings on a pendulum, and the fixed point actually moves on the x axis