I have seen this issue asked many times on this forum, but I haven’t seen a root cause. I have a simple cube with a cube collider and Rigid Body. I have a platform with a mesh collider NOT MARKED AS TRIGGER. I built an animation using an animator that rises the platform by simply changing the transform’s position’s y axis.
When I drop the cube on the platform it stops on it and sits there like you would expect. But when I run the animation on the platform, the cube stays in its world space, essentially going through the platform until the platform is no longer contacting the cube. At this point, the cube falls to the “ground”. Why does this happen? Why do you have to manipulate the platform via script rather than being able to use an animation?
The animation is not intended for physics behaviour but visual esthetics. So, an animation will “draw” the objects not by “moving them but placing them”. If you write a loop script that deletes your cube and then create it again with a little displacement the box will not collide with the platform, it will be created “inside” of it each time. That’s how animation works. If animations controlled physics and collisions most of them wouldn’t work. For instance if you have a man walking and his legs have collision properties the knees would never bend the knee cause both parts of leg would collide. If his feet would collide with ground it would be unable to walk or his body would react strange, if unity had a very complex method to calculate forces and force reactions, and that wouldn’t fit the needs of everyone. I hope you get the point.
This happens because the animation is not moving the platform with physics, the animation basically teleports the platform to its new position every frame. This does not cause any physics calculations between the two objects.
To have the animation affect physics you can toggle the flag “Animate Physics” on the Animation component on the platform and add a rigidbody to it which you mark as kinematic.