unity rigidbody code code example Example 1: unity rigid body variable public Rigidbody rigidbody; Example 2: unity rigidbody private Rigidbody rigidbody