Conveyor belt rotates my box

I’m trying to make a box moving in a conveyor belt, so I read on a different thread that I should set the box rigidbody velocity (or apply a force) using OnCollisionStay.

The problem I have is that when I run the code, the box instead of moving on the ground, starts rotating.

Is this some problem with friction?


This is the code I’m using…

  void OnCollisionStay(Collision collisionInfo) {
   collisionInfo.rigidbody.velocity = 10 * transform.right;

Yes, it’s a friction issue; it seems to be a comparable situation to jumping out of a moving car and hitting the road and immediately starting to tumble… Instead of changing the velocity instantly, try applying a force over time.

Also, have you considered just scripting a ‘real’ physical conveyor belt (where it’s made of multiple kinematic box colliders that move left-to-right and recycle?) It might perform better than you think.