This tutorial will show you how to set up advanced physics constraints to synchronize the rotation of gear-like mechanisms.

Basics

First you'll need to know the basics; how to add gears and how to set up a master and slave gear. You should already be familiar with physics Point Constraints, Meshes, and Rigidbody components.

Adding the Master Gear

Optionally, you can use a smaller range of values for Minimum X Angle and Maximum X Angle if you don't want the gears to rotate fully.


  • This line may be easier to see if you turn on Wireframe mode (Alt + W).
  • If you do want the gear to "wobble" as if it's loose on its axle, use a non-zero Maximum YZ angle.
  • If your gears' physics proxies will come into contact with each other, we suggest you disable Send Collision Signal in the Rigidbody Properties and enable the Point Constraint component's No Attachment Collisions.

Adding the Linker Entity

Adding the Slave Gear

Synchronizing the Gears

  • You might want to experiment with positive damping values for the Point Constraint to prevent the gears from spinning forever. Values of 0.1 to 0.4 are typical, but it depends on mass and the desired effect. (for example, making the rotation appear to stop naturally from friction).
  • To change the direction of rotation on a slave gear, move the master gear's Plane Constraint to the other side of the master gear.
  • The distance between the master gear and the Plane Constraint will determine the ratio of rotation between the master and the corresponding slave gear. This is especially useful for gears with different sizes.


  • Always show your physics proxies when testing this feature, and make sure that your physics proxy is consistent and up to date with the actual mesh. An easy way to reset physics and regenerate the proxy is to simply delete the entity and then undo.
  • Since gears themselves are fairly complex meshes, we advise generating simple cylinder proxies to handle collisions. You might also try limiting the diameter of the proxy to the main body of the gear rather than extending to the edge of the teeth, since the gear teeth are unlikely to move in perfect imitation of physical engagement, and such a proxy avoids collisions between the gear teeth.
  • Be aware that link names are case sensitive!
  • Never scale meshes. This will create inconsistencies between the render and the physics proxy that will produce unexpected behavior. This will become obvious when you reveal proxies and see the issue.
  • The ratio of movement between a master and slave gear can be controlled by the position of the Plane Constraint component. Specifically,the ratio is the same as the ratio of the distances (radii) to the contact point. For example, if a large gear has distance R and a small gear has distance r, for each full rotation of the large gear πR the small gear will have to make (2πR)/(2πr) = R/r rotations.

Advanced Setups

Of course this gear functionality is not limited to one master gear and one slave gear, or making the gears turn in opposite directions. You can have many "slave" gears driven by a "master," but you must use a separate Plane Constraint component for each slave gear, using a unique link name for each Plane Constraint's Target Link Name (the link to the corresponding slave gear) and the same name of the link to the linker entity for each Plane Constraint's Helper Link Name.

You can also use slave gears as masters to drive additional gears linked directly to them. The Point Constraint on this master/slave gear will serve both its slave and master functions, but you will need to add a Plane Constraint component to the master/slave gear for each of its slave gears, along with the appropriate link names as described above.

Multiple Slave Gears

Setting up multiple slave gears is fairly straightforward. 

It may be beneficial to rename the links to describe which gears they link to, rather than just an arbitrary "slave-1", "slave-2" etc, which may become confusing when adding more and more slave gears.

Non-Parallel Location

Of course, gears aren't always positioned neatly in a straight line; sometimes a slave gear is off to the top left or right of the master gear. All you really need to do is move the gear and rotate the Plane Constraint. Rotating the Plane Constraint is not done with Transform → Rotation, however. The property you'll need for this is Axis:


Change Axis for rotation Plane Constraint

Be sure to first carefully at the entity links on your master gear and be sure that you're moving the correct plane constraint!

Together with changing the Translation, you can position the Plane Constraint perpendicular to the contact point between the master and slave gears, like this:


Plane Constraint rotated

Now they will rotate like this, in opposite directions, as if intermeshed:


Offset slave gear rotating

Rotating in Same Direction

If you want your gears to rotate in the same direction, like for example wheels in tank treads do, this is how you need to set it up:

 Multiple Masters and Slaves

Finally, any slave gear can also be used as a master gear to drive its own set of slave gears if necessary; you simply need to set up the same links and plane constraints between the secondary master and its slaves (in addition to that secondary master being a slave to a primary master).

Video Tutorial

For more detailed information and to watch a video tutorial about these setups, see below.