Welcome to the Versatile Third Person Controller Documentation
Here you'll find comprehensive guides and documentation to help you get started with the Versatile Third Person Controller and make the most of its features. Whether you're a beginner or an experienced developer, our documentation is designed to provide you with all the information you need.
Table of Contents
- Overview
- Features
- Movement States
- Core Systems
- Advanced Features
- Specialized Systems
- Development and Customization
- Compatibility and Integration
- Importing and Setting Up Animations
- Dependencies
- Installation
- Usage
Overview
Versatile Third Person Advanced Locomotion is a comprehensive third-person character system developed for Unity. It provides a robust and flexible framework for a variety of character movements and interactions, making it an ideal foundation for third-person games.
Features
- Versatile Character Movements:
- Walking
- Jogging
- Sprinting
- Crouching
- Crawling
- Taking cover
- Climbing
- Parkour actions
- Rolling
- Interacting
- Health and stamina management
- Dying
- IK for both hand and foot placement
- Dynamic Camera System: The system incorporates two virtual cameras - a standard camera and an aim camera, providing diverse perspectives for gameplay.
- Interactive Environment: Characters can interact with various elements in the environment such as doors and elevators, enhancing the immersive experience.
- Stamina and Health Systems: Characters have a stamina system that depletes with prolonged activity and recharges during rest. The health system is designed to decrease when the character jumps from significant heights, with the damage proportional to the jump height.
- Interfaces: The system includes predefined interfaces for interactable objects, health, and stamina, providing a structured approach to character interactions.
- Animation Rigging: The system leverages animation rigging for more realistic and fluid interactions with doors and elevators.
- Input System: The system uses Unity's new Input System for handling player input, providing a more efficient and flexible input management solution.
- Character States: The system includes various character states such as idle, walk, run, sprint, crouch, prone, climb, vault, roll, cover, and parkour, allowing for seamless transitions between different character actions.
- Cover System: The system includes a cover system that allows characters to take cover behind objects, peek around corners, and transition smoothly between cover and combat states.
- IK System: The system includes an Inverse Kinematics (IK) system for hand and foot placement, enhancing the character's interactions with the environment.
- Climb System: The system includes a climbing system that allows characters to climb ladders, walls, and other vertical surfaces, providing more dynamic movement options.
- Parkour System: The system includes a parkour system that allows characters to perform parkour actions such as jumping over different obstacles with different values, adding more depth and variety to character movements.
- Dynamic Collider System: The system adapts the player's collider properties in real-time, ensuring optimal interaction with the environment. This system enhances realism and responsiveness, particularly in dynamically changing environments such as uneven terrains and varying slopes.
Movement States
Available States: Idle, Walk, Jog, Sprint, Jump, Crouch, Crawl, Cover, Climb, Roll, Parkour, Interact, Die.
Core Systems
- Player Movement Context Management: Includes Input System, Rigid-body, Capsule Collider, Health, and Stamina management.
- State Management System: Efficient handling of transitions between all movement states.
- Camera System Manager: Supports three cameras (standard, aim, crawl), with extendable options.
- Interaction Base System: Fully extendable for custom object interactions.
- Health System: Heal and damage functionality.
- Stamina System: Stamina consumption and recharge mechanics.
Advanced Features
- IK System:
- Base Class: The IK system is managed through a base class that enables flexible integration of both Foot-IK and Hand-IK systems.
- Foot-IK: Adjusts feet on uneven surfaces or slopes.
- Hand-IK: Supports object interaction and parkour actions.
- Dynamic Colliders: Real-time adjustment of center, radius, and height for optimized collision detection on slopes.
- Interfaces: Modular interfaces for input commands, player state management, health, stamina, and interactions.
Specialized Systems
- Climb System: Includes ladder, rope, and wall climbing, managed with a single script.
- Cover System: Dedicated script supports both high and low cover mechanics.
- Parkour System: A versatile parkour system with multiple actions, all managed via a single script.
Development and Customization
- Scriptable Objects: Simplified property management for character settings.
- Expanded Editor Controls: Expanded editor controls for movement behaviors.
- Automatic Setup: Automatically configures required components and scripts.
- Code Restructure: Clean, maintainable, modular, and readable codebase for easy integration and extension.
Compatibility and Integration
- AI Ready Systems: Health, stamina, and interaction systems are compatible with existing AI solutions.
Importing and Setting Up Animations
This system is designed to work with your animations. You will need to import and set up your animations to work with the various character states provided by the system. Here's a general guide on how to do this:
- Import your animation into your Unity project.
- In the Animator Controller for the player, create a new state for each animation.
- Set up the transition conditions to and from each state.
- In the corresponding script for each state (e.g., PlayerClimbState, PlayerCoverState, PlayerParkourState, PlayerRollState), assign your animation to the appropriate variable.
Please note that each animation should be set up to work with the variables in the corresponding state script. These variables control the speed, duration, and other aspects of the animation, and can be adjusted to customize the behavior. For more detailed instructions and information about the system, please refer to the full documentation.
Dependencies
This project relies on the following Unity packages and components:
- Unity Packages:
- Cinemachine: For the dynamic camera system.
- Animation Rigging: For enhanced character animations.
- Input System: For using the new input system.
- Third-Person Starter Asset: For the character in the demo scene.
- Unity Components:
- Animator: To control the character's animations.
- IK: To control the character's Inverse Kinematics.
- CapsuleCollider: To handle the character's collisions.
- Rigidbody: To apply physics to the character.
- InputActionManager: To handle the character's input using the new Input system.
- Scripts:
- CharacterConfig: This is the main script that holds all the other scripts. It's used for adjusting the values of various game elements like movement, vaulting, rolling, and the capsule collider, cover, etc.
- InputActionManager: Manages player input.
- CameraSystemManager: Manages the camera system.
- PlayerController: Processes the inputs and the transitions between player states.
- PlayerHealth: Manages the player's health.
- PlayerStamina: Manages the player's stamina.
- PlayerBaseIKSystem: Manages the player's Inverse Kinematics.
- PlayerHandIKSystem: Manages the player's hand placement.
- PlayerFootIKSystem: Manages the player's foot placement.
- InteractableBaseSystem: Manages interactions with interactable objects.
- CoverObject: Handles interactions with cover objects.
- ClimbObject: Handles interactions with climbable objects.
- ParkourObject: Handles interactions with parkour elements.
- Door: Handles interactions with doors.
- Elevator: Handles interactions with elevators.
- Other scripts: These include scripts for different character states (e.g., PlayerCoverState, PlayerClimbState). Each script controls a specific aspect of the character's behavior.
Please ensure you have these dependencies installed and assigned in the Unity editor before using the Versatile Character Controller.
Installation
To install the Versatile Third Person Advanced Locomotion Controller, follow these steps:
- Purchase and download the project from the Unity Asset Store.
- Open Unity and import the project.
- Ensure you have the required dependencies installed: Cinemachine and Animation Rigging.
Usage
Here's a basic example of how to use Versatile Character Controller:
- Add the character to your scene.
- Configure the character's movements and interactions as needed.
- Play the scene to see the character in action.