Game Development Reference
In-Depth Information
With less mass (weight/volume), you get a lot more bounce with the reaction.
5.
Stop Play mode.
6.
For the middle cube, turn off Use Gravity.
7.
Click Play.
Having been clipped by the top cube, the Bouncy cube tumbles slowly downward, floating upward
when it collides with the bottom cube.
The Is Kinematic Parameter
There are a few different ways to freeze an object with a Rigidbody component so it won't be
affected by physics in the scene or will have limited freedom to react. The first method is using
the Is Kinematic flag. This is recommended when you have objects that are not being animated by
physics. In your test scene, the moving platform would qualify because a script is setting its location
dynamically during runtime. Objects with key-frame animation are another use case. If the animated
object has a collider and can interact with other dynamic objects in the scene, collision-detection
calculations are far more efficient with a Rigidbody component set to Is Kinematic.
To develop good working habits, you can go ahead and add a Rigidbody component to the
Cube Platform.
1.
Select the Cube Platform, set its Y Scale back to 0.25, and adjust its Y
location so the First Person Controller will be able to get onto it again.
2.
Enable its Hz_PositionCycler script component and its Box Collider.
3.
Add a Rigidbody component, and turn its Is Kinematic property on.
You could activate the First Person Controller and test the platform after enabling the Moving
Platform property in its Character Motor component, but you will see no difference in functionality.
Instead, let's look at another means of restricting physics reactions.
1.
Select the middle cube, and turn its Use Gravity parameter back on.
2.
Select the bottom cube.
3.
Check Is Kinematic, and click Play.
The bottom cube remains in place as the other two cubes interact with it. Because it is not doing
anything, it would probably be better to remove the Rigidbody entirely. In this case, however, there
are more experiments to run.
4.
Stop Play mode.
5.
Uncheck its Is Kinematic property.
6.
Under Constraints, check the X,Y, and Z Freeze Position parameters.
7.
Click Play.
 
Search WWH ::




Custom Search