Giter VIP home page Giter VIP logo

2d-platformer-character-controller's Introduction

2D Platformer Character Controller for Unity

Provides more precise and snappier controls for a platformer game than the default Unity character controller.

The repository contains all required assets for a demo scene to demonstrate the controller. The important files are in the Assets/Scripts/ folder.

Features

  • Raycast based collision detection
  • Wall jumping and wall sliding
  • Support for one-way platforms with the ability to drop through
  • Reactive jump: Jump input is still recognized right before and after being grounded or after touching a wall
  • Ability to control jump height by releasing the jump button mid jump

Not supported:

  • Slopes
  • Moving platforms

Setting up

  1. Add the MovementController.cs and Player.cs scripts to your player game object.
  2. Make sure the player has a Box Collider 2D attached to it.
  3. Set up the collision masks inside the inspector.
  4. Start tweaking the parameters!

One-way platforms:

  1. Attach Edge Collider 2D to the platform game object.
  2. Tag the platform as Platform.

Pressing "Down" on a platform will make the player fall through it.

Resources:

2d-platformer-character-controller's People

Contributors

vrompasa avatar

Stargazers

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

Watchers

 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.