Giter VIP home page Giter VIP logo

thirdpersoncamera's Introduction

Third Person Camera

A highly configurable feature-rich third person camera.

Features

  • Tons of configuration options
  • Layer based reposition clipping
  • Over-the-shoulder horizontal offset and realtime shoulder swapping
  • Zoom, rotate horizontally/vertically, adjust height
  • Separate horizontal and vertical rotation speeds and sensitivities
  • Extensible
  • Control the camera through scripting or let it update itself with Unity's Input system
  • Inlcluded prefab works out of the box

Example

Changelog

  • 1.1.1 (Current)
    • Added function to retrieve a world-raycasted point given a screen point
  • 1.1.0
    • Added lookTarget property to override lookInput, causing camera to forcibly rotate to look at another transform.
    • Removed [ExecuteAlways] from the camera's behaviour
    • Fixed _targetZoom bug in Start() and inspector editing
    • Added some public utilities
  • 1.0.1
    • Package fix for importing into Unity through the Package Manager
    • Small code adjustments
  • 1.0.0
    • Initial release

Getting Started

  1. Add the package to Unity through the Package Manager or download the zipped version and extract it to your assets folder.
  2. Drag and drop the Samples/ThirdPersonCamera.prefab into your scene.
  3. Assign a follow target if needed.

    That's it!

Configuration

Nearly every field on the ThirdPersonCamera component has a tooltip.

Inspector

Field Description Example Value
Draw Debug Enables debug logging and additional debug lines.
Draw Gizmos Enables gizmos.
Follow Target The Transform the camera should physically follow. Your character, any POI, etc.
Self Get Player Input Allows this camera to retrieve input data to update itself without external intervention.
Invert Horizontal Camera Input All incoming horizontal input will be inverted.
Invert Vertical Camera Input All incoming vertical input will be inverted.
Move Lerp Speed How fast the camera lerps to the assigned follow target. 10
Zoom Lerp Speed How fast the camera's zoom lerps in and out. 10
Min Zoom In How close the camera can zoom into its origin. 1
Max Zoom Out How far the camera can zoom out from its origin. 30
Camera The actual camera component.
Height Transform The transform which controls the height aspect of the camera. Must be a child of the main transform.
Horizontal Offset Transform The transform which controls the horizontal offset, the "over the shoulder" aspect. Must be a child of the height transform.
X Axis The transform which controls X axis rotation. Must be a child of the horizontal offset transform.
Camera Transform The transform which has the Camera component on it. Must be a child of the X Axis transform.
Look Up Max Angle The "maximum" look up angle in degrees. This is usually a negative number since a negative angle is required to rotate the camera upwards. -60
Look Down Min Angle The "minimum" look down angle in degrees. This is usually a positive number since a positive angle is required to rotate the camera downwards. 90
Horizontal Rotation Lerp Speed How fast the horizontal rotation lerps. 1
Horizontal Rotation Sensitivity The horizontal rotation sensitivity. 1
Vertical Rotation Lerp Speed How fast the vertical rotation lerps. 1
Vertical Rotation Sensitivity The vertical rotation sensitivity. 1
Camera Clipping Layermask All layers that the camera can be clipped with. Default
Forward Camera Clip Radius The forward raycast spherical radius for detecting camera clipping. 0.1
Horizontal Camera Clip Radius The horizontal raycast spherical radius for detected camera clipping. 0.1
Camera Clip Point Offset How far away from the raycasted clip point the camera will be placed on the hit point's normal. 0.25
Camera Clipping Lerp Speed How fast the camera lerps to the clip point offset. The higher the value, the less likely clipped geometry will be visible. 100

thirdpersoncamera's People

Contributors

austephner avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

limuwan

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.