Game Development Reference
In-Depth Information
With the Rigidbodies, you will want to try two experiments. The first is to see if moving Rigidbodies
can affect the First Person Controller, and the second is to see if the First Person Controller can
affect Rigidbodies.
1.
Stop Play mode.
2.
Deactivate the Cloth and Flap objects.
3.
Duplicate the middle cube.
4.
Activate the new cube, and move it so that its Constant Force will push it into
the First Person Controller.
5.
Click Play, and watch the result.
The cube either stops at the First Person Controller or twists and continues along its way.
6.
Increase the cube's Force value to 1000 (or -1000 if you are using a negative
number).
7.
In the Rigidbody component, increase the Cube's Mass to 50 .
8.
Click Play.
The result is the same: the cube is unable to move the First Person Controller.
Next you will test the opposite scenario by driving the First Person Controller at the box.
1.
Stop Play mode.
2.
Set the Cube's Mass back to 1 and its Force back to 10 (or - 10 ).
3.
Click Play, and drive the First Person Controller at the moving cube.
The First Person Controller is able to push the Cube away.
4.
Stop Play mode.
5.
Set the Cube's Force to 0 .
6.
Click Play, and drive the First Person Controller into the Cube.
When the cube is not being moved by physics, the First Person Controller is not able to influence
its movement. To directly affect an object with a Rigidbody component, you would have to apply a
physics force through scripting using the First Person Controller's direction to calculate the direction
of a one-off force.
7.
Stop Play mode.
By now, you probably realize why game physics are not comparable to real-world physics. Not only
are the algorithms stripped down for speed, but the functionality itself is severely limited to control
CPU usage. The important thing to remember when designing your game's functionality is not to
take any physics-based functionality for granted. Some desired behavior can be enabled though the
Rigidbody and other physics-related component's parameters, but other behaviors, if even feasible,
may require specialized scripting.
Search WWH ::




Custom Search