Hi all!
We have a need in our game to put a shoe in a washing machine (!).
- The drum is a non-convex shape, with a mesh collider.
- The shoe is a RigidBody with a mesh collider.
Now - when we get the drum to spin (using regular rotate transform things) we need the shoe to react to friction - but the shoe stays put. So I tried adding a RigidBody to the drum and applying torque instead of rotations. This couldn’t be kinematic for this reason.
But…“RigidBody + non-convex no longer supported in Unity 5…”
Does anyone know of an approach that can deal with this?
Cheers
M.
Here are a few ideas:
Make the drum rotate, but keep the collider stationary (not rotating)
The shoe is now essentially trapped inside a not moving at all, concave…drum.
When ever the shoe touched the collider, add a Force(AtPosition*) in the direction of the drum: the normal at the contact point but rotated 90deg (I think it’s clear what I mean lol).
*at the contact point
suggestion 2: don’t use a meshcollider for the drum, but place several box colliders ‘around’ the drum.
Use a script to position them and it’s faster, and also more reliable (shoe will more likely stay INSIDE the drum).
The problem with MeshColliders is, that real washing machines use them. That’s the reason socks do disappear from time to time. Those socks then fall through a leak in the matrix and …edited by the NSA.
1 Like
Ahh your first suggestion - that may just work! (so would the second, but in the interests of learning - the first would be a good start).
Just a bit unclear as to what you mean when you say “normal at the contact point but rotated 90deg”?
Presumably, I need to somehow determine the actual point of the shoe that caused the collision with the drum (using a trigger?) - is that an easy task?
And yeah, I always did wonder where my socks ended up…
No, you just need your colliders - no trigger. Unity - Scripting API: ContactPoint.point
But this setup would just be a start. Best practice here is sitting in front of a washing machine and trying to figure out what IS essentially happening, how can it be described in an Easy way.
‘Normal at contact point but rot. 90 deg’
sorry for being unclear.
Just look at the picture but ignore the vectors pointing to the middle (stole the picture from Google)

awesome. so just a bit of OnCollisionEnter rather than OnTriggerEnter, right?
thanks for your help!