physics collision speed problem

I’ve been struggling with physics and still, after reading documentation, watching tutorials and searching on the answers page I can’t get my scene to work.

I have a light object (a fly), suspended in the air (use gravity=false) that gets hit by a moving heavier object (flyswatter). Purely based on physics I expect the light object to be swept away, so it should start moving in the same direction as the flyswatter. Well, it doesn’t. Most of the times it does not move at all, sometimes it moves in the opposite direction, but slowly. It also does not seem to matter if the flyswatter moves fast or slow.

i made a simple testscene where the fly is a sphere with scale (0.1,0.1,0.1) and the flyswatter a cylinder with scale (0.5,0.05,0.5). Both objects have rigidbodies, the fly with mass=0.1, the flyswatter with mass=10, both have colliders, a sphere collider for the fly, a convex mesh collider for the flyswatter (the cylinder has a default capsule collider, but that sticks out on the flat ends of the cylinder).

There is a collision detection script on the fly and I can see that the collision is detected. but the velocities at the collision are weird:
Collision detected with: Flyswatter
Flyswatter velocity:(0.0, 0.0, 0.0) Flyswatter angular velocity: (0.0, 0.0, 0.0)
Relative velocity: (0.0, 0.0, 0.0)
Collision detected with: Flyswatter
Flyswatter velocity:(0.0, 0.0, 0.0) Flyswatter angular velocity: (0.0, 0.0, 0.0)
Relative velocity: (0.1, 0.0, 0.0)

I had the collision detection settings to continuous, but also changing it to discrete or continuous dynamic does not make a diifference (the collision is detected in all cases, but the velocities are wrong).

I also tried changing the Use gravity settings, to see if that might help, but it also does not make a difference.

So I hope someone can point me in the right direction.

There are a few things that may cause this.

How big are the colliders? Isn’t the flyswatter collider too thin to register? Also instead of using a convex mesh collider, try to give it two collider, one capsule for the handle and a box collider for the square part. You can also try to increase the physic steps.

I was using the transform to move the flyswatter based on Input.GetAxis(“Horizontal”) and Input.GetAxis(“Vertical”). I know from the documentation that you should not use rigidbody.transform directly if you want to use physics. But I was using gameobject.transform, so I thought that would be ok. But it is not. Also gameobject.transform is apparently messing up physics.

When I used AddForce to move the flyswatter the collision velocity and the expected behaviour was fine.

I found this thread that uses rigidbody.velocity to move an object based on Input.GetAxis. and it refers to another thread that explains to use AddRelativeForce, with ForceMode.VelocityChange