ABSTRACT

This chapter explores creating a physics-based character and moving the character using physics forces. Basing a character on a physics object allows it to interact with any other physics objects in the game scene. Artists will be creating a character, picking an appropriate collider shape to simulate its interactions, and giving it a rigidbody—which allows it to have mass, drag, and gives artists physical forces something to interact with. In the code, they have created a character called robot friend who is moving around a square space and gathering spheres. Artists added a simple robot model to their scene hierarchy and named it RobotFriend. Next, they need to add a RigidBody component to their RobotFriend. The Rigidbody component is responsible for simulating the physical forces: gravity, drag, and giving our game object mass. Next, they need to add a collider component. They selected a Capsule Collider component and added it to their RobotFriend game object.