Collision projection problems when manually updating location

I made a conveyor belt that has its elements moving on a spline, following its path.

Here’s a video of the problem: [Update location projection problem - YouTube][1]

When a cube is “traveling” on the conveyor belt, it is projected outwards when is reaches an inflexion point.

The elements are box collisions that are not simulating physics. I use SetWorlLocationAndRotation to update their state each frame.

238121-set-location-and-rotation.jpg

This probably happens because there are multiple elements that penetrate the cube at the same time and they cannot give way so the cube is projected to resolve the internal tension problem.

What can I do to fix this? Is there a special way to update the elements location in order to not have this happen?

The only other option that I can think of is to have the elements tied to some control points by physics constraints and update those control points, but that would probably have a significant performance hit. It would mean adding dozens of physics constraints.

I figured out what the problem was.

When the cube gets ejected, it’s because the collision was rotated at 180 degrees (the rotation of the collision was following the tangent of the curve so when the tanget got flipped, so did the rotation) and that gets computed as a huge force on the cube. Because it was symmetrical, it was hard to notice the rotation.

So if you encounter a case like this, make sure that the object that you’re updating isn’t somehow flipped, or rotated at 180 degrees, because it will impart a lot of force on the object that it’s in contact with.