• Stars
    star
    620
  • Rank 71,996 (Top 2 %)
  • Language
    C#
  • License
    MIT License
  • Created almost 3 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Open Source Kinematic Character Controller for Unity

OpenKCC

This project is a sample of the Open Kinematic Character Controller. A Kinematic Character Controller (KCC) provides a way to control a character avatar as a kinematic object that will interact with the environment.

OpenKCC is an open source project hosted at https://github.com/nicholas-maltbie/OpenKCC

This is an open source project licensed under a MIT License. Feel free to use a build of the project for your own work. If you see an error in the project or have any suggestions, write an issue or make a pull request, I'll happily include any suggestions or ideas into the project.

Designing Character Controllers Video Introduction

You can see a demo of the project running here: https://nickmaltbie.com/OpenKCC/. The project hosted on the website is up to date with the most recent version on the main branch of this github repo and is automatically deployed with each update to the codebase.

Installation

Make sure to add the required dependencies to your project

In order to use the samples in the project, make sure to also add the following projects to your project.

Install the latest version of the project by importing a project via git at this URL: git+https://github.com/nicholas-maltbie/OpenKCC.git#release/latest

If you want to reference a specific tag of the project such as version v1.0.1, add a #release/v1.0.1 to the end of the git URL to download the package from th auto-generated branch for that release. An example of importing v1.0.1 would look like this: git+https://github.com/nicholas-maltbie/openkcc.git#release/v1.0.1.

To use the latest release, simply reference:

git+https://github.com/nicholas-maltbie/openkcc.git#release/latest

For a full list of all tags, check the OpenKCC Tags list on github. I will usually associated a tag with each release of the project.

Note: before I started using the package format for the project, I manually released a unity package you needed to import. Any version before v1.0.0 will not work to import the project.

If you do not include a tag, this means that your project will update whenever you reimport from main. This may cause some errors or problems due to experimental or breaking changes in the project.

You can also import the project via a tarball if you download the source code and extract it on your local machine. Make sure to import via the package manifest defined at Packages\com.nickmaltbie.openkcc\package.json within the project.

For more details about installing a project via git, see unity's documentation on Installing form a Git URL.

Scoped Registry Install

If you wish to install the project via a Scoped Registry and npm, you can add a scoped registry to your project from all of the com.nickmaltbie packages like this:

"scopedRegistries": [
  {
    "name": "nickmaltbie",
    "url": "https://registry.npmjs.org",
    "scopes": [
      "com.nickmaltbie"
    ]
  }
]

Then, if you want to reference a version of the project, you simply need to include the dependency with a version string and the unity package manager will be able to download it from the registry at https://registry.npmjs.org

"dependencies": {
  "com.nickmaltbie.openkcc": "1.0.1",
  "com.nickmaltbie.screenmanager": "3.0.0",
  "com.nickmaltbie.statemachineunity": "1.1.0",
  "com.nickmaltbie.testutilsunity": "1.0.0",
  "com.unity.inputsystem": "1.0.0",
  "com.unity.textmeshpro": "3.0.0"
}

Tests

If you wish to include the testing code for this project, make sure to add the com.unity.inputsystem and com.nickmaltbie.openkcc to the testables of the project manifest.

  "testables": [
    "com.nickmaltbie.openkcc",
    "com.nickmaltbie.testutilsunity",
    "com.unity.inputsystem"
  ]

Additionally, some of the testing code uses pro builder's api, so make sure to import com.unity.probuilder version 5.0 or newer as well..

Samples

In order to run the samples from the project, you must import the following projects:

The samples in the project include:

  • ExampleFirstPersonKCC - Example first person character controller with a basic test scene.
  • SimplifiedDemoKCC - Simplified character controller with basic movement scripts.
  • ExampleColliderShapes - Example of different collider shapes for players.

Netcode Example

Using Unity's netcode package I created another example package called com.nickmaltbie.openkcc.netcode with a sample NetcodeExample for an example of setting up the OpenKCC as a networked character controller.

To add the netcode example to your project, you can download it from one of the release branches under the pattern release/netcode/version or from the npm repo with the name com.nickmaltbie.openkcc.netcode. It contains some useful utility classes in addition to the sample.

The sample is hosted online at https://nickmaltbie.com/OpenKCC/Netcode/ but you will need to host a server on a windows/linux/mac machine as the WebGL build for unity does not support opening a server socket within WebGL.

Required packages for samples that are not already included in the project:

{
  "scopedRegistries": [
    {
      "name": "nickmaltbie",
      "url": "https://registry.npmjs.org",
      "scopes": [
        "com.nickmaltbie"
      ]
    }
  ],
  "dependencies": {
    "com.community.netcode.transport.websocket": "git+https://github.com/Unity-Technologies/multiplayer-community-contributions?path=/Transports/com.community.netcode.transport.websocket",
    "com.nickmaltbie.recolorshaderunity": "1.0.0",
    "com.unity.inputsystem": "1.4.4",
    "com.nickmaltbie.testutilsunity": "1.0.0",
    "com.unity.netcode.gameobjects": "1.1.0",
    "com.unity.probuilder": "5.0.6"
  }
}

The samples in the project include:

  • ExampleFirstPersonKCC - Example first person character controller with a basic test scene.
  • Mole KCC Sample Character - Example mole character controller for moving around and climbing on objects.

Documentation

Documentation on the project and scripting API is found at https://nickmaltbie.com/OpenKCC/docs/ for the latest version of the codebase.

To view the documentation from a local build of the project install DocFX, use the following command from the root of the repo.

Documentation/build.sh

(Or this for windows)

.\Documentation\build-validation.cmd

The documentation for the project is stored in the folder /Documentation and can be modified and changed to update with the project.

This documentation project is inspired by the project by Norman Erwan's DocFxForUnity

Learning

I will be making a video series discussing how the Open KCC works and going into detail about how the various features work, describing game design in general, and details about the unity engine and virtual environments.

As these videos are created they will be listed here:

Development

If you want to help with the project, feel free to make some changes and submit a PR to the repo.

This project is developed using Unity Release 2023.1.3f1. Install this version of Unity from Unity Hub using this link: unityhub://2023.1.3f1/e00e24c187a5.

Git LFS Setup

Ensure that you also have git lfs installed. It should be setup to auto-track certain types of files as determined in the .gitattributes file. If the command to install git-lfs git lfs install is giving you trouble, try looking into the installation guide.

Once git lfs is installed, from in the repo, run the following command to pull objects for development.

git lfs pull

Githooks Setup

When working with the project, make sure to setup the .githooks if you want to edit the code in the project. In order to do this, use the following command to reconfigure the core.hooksPath for your repository

git config --local core.hooksPath .githooks

More Repositories

1

StateMachineUnity

State Machine Utility Package for Unity Projects
C#
24
star
2

ScreenManager

Unity plugin for managing multiple layers of UI Screens in games.
ShaderLab
20
star
3

FallingParkour

Multiplayer racing game made with Unity
C#
18
star
4

TileMaps

Example repository for organizing generic tile maps in Unity with C#
C#
17
star
5

PoolSet-Unity

Example pool set project using Unity 3D
C#
15
star
6

NetworkStateMachineUnity

Expanding the StateMachineUnity repo to work with a networking option.
C#
13
star
7

Godot-OpenKCC

Godot Open-Source Kinematic Character Controller
GDScript
12
star
8

PropHunt

PropHunt game attempt using Unity and the Data Oriented Technology Stack
C#
11
star
9

Recolor-Shader-Example

Example Showing How a Recolor Shader in Unity Works
Shell
9
star
10

TemplateUnityPackage

Template Unity Package Project for Sharing Code via git and npm
C#
9
star
11

Scrolling-Shaders-Example

Animating scrolling shaders example in unity using URP
C#
6
star
12

RecolorShaderUnity

Recolor shader for unity projects via URP
C#
6
star
13

TestUtilsUnity

Utility test functions and classes for Unity
C#
6
star
14

PropHunt-Mirror

PropHunt project made using Unity and Mirror Networking
C#
5
star
15

TemplateUnityProject

Template Unity Project for setting up a simple unity game with GitHub pages.
C#
4
star
16

gddoc2yml

Convert godot xml docs to docfx yml
Python
4
star
17

GGJ-2023

Isle of Roots
C#
3
star
18

Industrial-Hack

GE GhostHack event for 'OSINTICS for 500'. Attempt to find contact info for people who need to fix their systems.
Python
3
star
19

ParallelEnvironment

Final Project for CS6068: Parallel Computing. FS 2019
C#
3
star
20

Treachery-Old

Developing Treachery Video Game
C#
2
star
21

HexUnity

Making a Sphere of hexagons in unity
C#
2
star
22

FakeMidi

Using midi file format to improvise music from lead sheets.
Java
2
star
23

CharacterControlsDemo

Character Controls Demo for Requirements Engineering and Test Driven Development.
C#
2
star
24

MinimapTools

Minimap tools for unity projects
C#
2
star
25

Medina

An attempt to utilize machine learning to play the board game Medina
Python
2
star
26

UC-Path-Program

Web based path finding program for UC's main Campus
HTML
2
star
27

pasta-like-rest

Rest Server for the pasta like server
Python
2
star
28

SpaceshipMurderTime

Creating a clone of Among Us for Make UC Hackathon
C#
2
star
29

godot-gdextension-summator-productator

Example Godot GDExtension for a multiple addons
C++
1
star
30

PropHuntDevLog

PropHunt Development Log
HTML
1
star
31

ProjectCage

Project for Game Jam 2021 with IGDA with other students at UC. Working Title: Project Cage
C#
1
star
32

pasta-like-react

React front end for our pasta like rouge like app
JavaScript
1
star
33

PlayerCountMessage

This is a plugin for Bukkit Minecraft to change the player list message, motd and server icon
Java
1
star
34

GameOfLife

Conway's Game of Life
XML
1
star
35

Qwixx

A Java implementation of the board game Qwixx
Java
1
star
36

nicholas-maltbie.github.io

Attempt to make jekyll website
SCSS
1
star
37

CSO-Analysis

Analysis of Combined Sewer Overflow Dataset for FSE21 Paper Submission
Jupyter Notebook
1
star
38

BarkBark

Project for class Software Engineering EECS-3093C course
CSS
1
star
39

CudaPerformanceRaycase

Looking into performance of Cuda with raycase for class assignment
C
1
star
40

Nick-Unity-Shader-Collection

Package collection of shaders for use across various unity projects.
1
star