Description
The UseCollisionRules
property of the CharacterController
class determines whether the character controller should use the current project's collision rules based on the Tags
of the containing GameObject
. When enabled, the character controller will adhere to the collision rules defined in the project, allowing for more controlled and predictable interactions with other objects in the scene.
Usage
To use the UseCollisionRules
property, simply set it to true
or false
depending on whether you want the character controller to follow the project's collision rules. This can be useful for ensuring that the character interacts with the environment in a consistent manner according to the game's design.
Example
// Example of setting the UseCollisionRules property
CharacterController characterController = new CharacterController();
// Enable the use of project collision rules
characterController.UseCollisionRules = true;
// Disable the use of project collision rules
characterController.UseCollisionRules = false;