Coder Social home page Coder Social logo

pixelwizards / thirdpersoncontroller Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 9.0 16.07 MB

Simple 3rd person controller demonstrating camera-relative movement and the new Cinemachine 3rd Person Follow / Aim system

License: MIT License

C# 97.44% ShaderLab 2.56%
cinemachine-3rd-person camera cinemachine animation-controller gta character root-motion

thirdpersoncontroller's Introduction

GTA Style 3rd Person Controller / Camera Example

Simple 3rd person controller example for Unity demonstrating camera-relative movement, root motion animation and the new Cinemachine 3rd Person Follow / Aim system

ThirdPersonController

Full video

https://www.youtube.com/watch?v=e9YOstnzfKY

There are 2 core scripts:

CharController.cs

This is the main character controller. Using a super simple 1D linear animation controller and root motion for the character movement, this script provides camera-relative movement and animation for a character (similar to GTA).

CharacterController

The Animation Controller is very simple and only requires 2 animations, Idle & Walk.

This may get extended to add more animations (run etc), but I wanted to keep it as simple as possible.

ThirdPersonCameraController.cs

This script wraps the new 3rd person follow camera extension that ships with Cinemachine 2.6.x and higher.

Supports toggling which side the camera is on (ala Ghost Recon Wildlands) and also exposes inverting for vertical and horizontal camera rotations.

CameraController

Usage, etc

Main branch updated to use 2020.3

You can find 2019.4 versions in the branch /versions/2019.4

This repo uses Git LFS.

Licensed under the MIT License

thirdpersoncontroller's People

Contributors

gekidoslair avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.