How to enable Collision Detection
The steps to enable collision-detection to act on a 3D character are summarized below:
Create an instance of a Dynamic Action
Set Coefficient of Restitution for character (optional)
Set Mass of character (optional)
Step 1. Create a Dynamic Action
To enable Collision Detection on a game character, first create an instance of U4DEngine::U4DDynamicAction as shown on line 1. Then enable kinetic behavior on the dynamic action as shown on line 2 and enable collision detection as shown on line 3. At this moment, the Collision Detection System will be able to detect collision on the object.
Step 3. Set the Coefficient of Restitution & Mass (Optional)
The Coefficient of Restitution determines the bounciness of the character. The value ranges from 0.0 to 1.0. A value of 1.0 represents a lot of bounciness and is set using initCoefficientOfRestitution().
Let's set the Coefficient of Restitution to a medium level 0.5. And set the mass of the astronaut to 1.0.
Result
Last updated