Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
U

unity-genshin-impact-movement-system

> 编程语言
Open source

A movement system made in Unity that attempts to replicate Genshin Impact Movement.

660 stars0 likes1 views
WebsiteGitHub

About

A movement system made in Unity that attempts to replicate Genshin Impact Movement.

Genshin Impact Movement System

An attempt on replicating 3 (Moving, Gliding, Swimming) Genshin Impact Movement Systems.

Engine

Available On

-%23FF0000.svg?style=for-the-badge&logo=YouTube&logoColor=white)

Used Assets

Provided Animations were downloaded from Mixamo.

Map Materials were downloaded from Kenneys Assets.

Tips

  • If you intend to Swap Animations, make sure you copy their Animation Events, otherwise some transitions won't work.
  • There's no particular reason why I made the Model "Generic" besides me not understanding enough about Animations.
  • There are no Control Schemes in the Input Actions, so Input only works for Keyboard & Mouse.
  • Because I use the [field: SerializeField] attribute, Unity 2020+ is required. 2020.3 LTS was used for this project.
  • If you want different settings for a smaller or taller character, you can create a new Player Scriptable Object and set the desired settings.
  • There's a Resizable Capsule Collider Component for you to add to any Game Object you want to resize your collider from the bottom only to be able to use the Floating Capsule technique. It should throw an error once when you first add it as a Component due to the OnValidate method likely being called before Unity serializes the data classes, but it should work fine. You can always initialize the [Serializable] classes in the Initialize method if you don't want that error showing.
  • 2 Layers are added from the Layer number 22 to 23, in hopes that there would be no problem in importing this System to your own project. All scripts have a base namespace and folder as well, so there should be no name conflicts.
  • A camera cursor script was added as an example on how you can enable or disable it. It isn't working like in the game, it's just there for you to have an idea how to get it enabled or disabled.
  • Different Animations can make the movement look better or worse.
  • I'm an amateur game developer, so do not expect the code to be the most elegant looking piece of beautiful meat out there.
  • If there's a Bug, you saw nothing.

Table of Contents

Unveil me!

  • Genshin Impact Movement System
    • Engine
    • Available On
    • Used Assets
    • Tips
  • Tutorial Series
    • Series Contents
  • Pro Builder
  • New Input System
  • Systems
    • Movement System
      • Cinemachine
      • States & State Machines
      • Floating Capsule
      • Physics-Based Movement
        • Player Movement
        • Player Rotation
        • Player Dash
        • Player Jump
        • Player Fall
        • Player Landing
    • Animations
    • Gliding System
    • Swimming System
  • License
  • Version
  • Contributing
  • Notes

Tutorial Series

Released code is only up to date to my last released Tutorial Series video.

To get an idea on what the Tutorial Series will end up providing, please refer to This Video.

Series Contents

The main goal of the Series is to teach game developers (mostly beginners) on how can they achieve something similar to Genshin Impact Movement System.

Here's the list of techniques used to make this System possible:

  • Pro Builder

    A Small Test Map was created for this Project.

  • New Input System

    The Old Input System was disabled for this Project.

    Version 1.3.0

  • Cinemachine

    A Virtual Camera was used to achieve the same or close to the same result as Genshin Camera.

    Version 2.8.4*

  • State Machines

    Hierarchy State Machines were used at their simplest implementation (State Inheritance).

  • Floating Capsule

    Allows Resizing the Capsule Collider without the Player falling due to Gravity.

    Makes it possible to climb steps and slopes.

  • Physics-Based Movement

    A Rigidbody was used for all the Player Movement.

    No Built-In Character Controller was used.

  • Animations

    Reusable Sub-State Machines were used for the Animations.

    No Blend Trees were used.

*As of this version, there's a bug that doesn't allow disabling the Cinemachine Input Provider actions, which could be used for disabling the Camera Rotation or the Camera Zoom. It should be fixed in future versions.

Pro Builder

A Small Test Map was created in hopes of being able to test all features this System will provide.

Uses Kenneys Prototype Textures as the Map Materials.

New Input System

The use of Unity New Input System allows the addition of callbacks whenever a key was pressed, changed or unpressed.

These translate to the actions of started, performed and canceled.

Features like only considering the key being pressed after an amount of time has passed is also easily achieved by using an Interaction.

The Camera also uses the New Input System.

The Project does not provide a Control Scheme and only provides you with Keyboard Inputs.

https://user-images.githubusercontent.com/71723988/163193573-92364ecc-90aa-4197-a0b4-ccf9c7a2550e.mp4

Systems

The plan is to develop and release 3 Genshin Impact Movement Systems. Means the System has been fully released on both Youtube and Github. Means the System has been fully developed but is awaiting release on both Youtube and / or Github or awaiting for another System release. Means the System is still in Development or requires something to be Fixed before it can be released.

Movement System

Cinemachine

The Player Camera imitates Genshin Impact Camera using Unity Cinemachine Package.

This is very likely what Genshin uses as well.

All 3 Systems have different settings for the Camera but it mostly works the same way.

The Camera offers an Orbital Rotation around the Player.

https://user-images.githubusercontent.com/71723988/163193893-925b1bda-f136-4e5d-b08a-72e8581fed69.mp4

Click here for longer video (47MB)

We can Zoom In and Zoom Out using the Mouse Scroll Wheel.

https://user-images.githubusercontent.com/71723988/163194107-40c4c560-6187-459d-8c03-65ff51b32611.mp4

Click here for longer video (83.6MB)

It also offers different Rotations at different angles or movement directions.

For example, moving the Player to the sides slowly rotates the Camera, which in itself rotates the Player, as the Player Rotation is relative to the Camera.

https://user-images.githubusercontent.com/71723988/163194247-a0c4165b-2689-452c-ad3e-4bc61bdfe19c.mp4

Click here for longer video (31.7MB)

When looking from the Top or Bottom, it also rotates faster, which makes the Player move in a small circular motion (much like in Genshin).

https://user-images.githubusercontent.com/71723988/163194317-fe6dc049-c7b6-42b7-9aa2-c9e940b75cb5.mp4

Click here for longer video (120MB)

There are several possible rotation outcomes, all of which I speak of in my Tutorial Series Video about Camera Recentering.

States & State Machines

The main logic of the Player Movement follows the State Machines Pattern.

I've decided to cache the existing States instead of instantiating new ones.

Therefore, changing to another State can be done through a similar code line: stateMachine.ChangeState(stateMachine.IdlingState).

https://user-images.githubusercontent.com/71723988/163194359-712e2003-7168-4b72-a835-f5efa6839bb9.mp4

Click here for longer video (42MB)

Floating Capsule

To prevent the Player from getting stuck on steps as well as to prevent the Player from jumping on slopes, a force is constantly added to the Player to keep it afloat.

A resizable capsule collider feature is provided, which is considered the same as the maximum climbable step height.

The size is only removed from the bottom.

https://user-images.githubusercontent.com/71723988/163194385-0fd32207-47b7-4c4b-ab67-350b7da342ec.mp4

To prevent the Player from falling due to Gravity when its collider is resized, a Ray is cast downwards and a (positive or negative) force is added to the Player depending on the distance from the collider center to the ground.

This allows the Player to keep itself at a constant height both when moving on slopes or when trying to climb steps.

https://user-images.githubusercontent.com/71723988/163194421-304d9aa2-2eee-40a9-bbe5-5854f405761a.mp4

Click here for longer video (55.2MB)

The idea was taken From This Video.

Physics-Based Movement

A Rigidbody is used for the Character Movement, meaning that it moves using built-in Physics.

Player Movement

The Ground Movement offers Walking, Running, Dashing, Sprinting, Landing and Stopping States as well as a way to swap between Walking and Running at the press of a Button.

There's also Jumping and Falling.

https://user-images.githubusercontent.com/71723988/163195407-64ca4ae0-43ca-49cd-8ec4-72ae23633601.mp4

Click here for longer video (95.5MB)

The Player also moves slower depending on the Slope / Ground Angle (An Animation Curve is used to set the Angles and Speeds).

https://user-images.githubusercontent.com/71723988/163194680-f1ca5f87-7c7d-47ff-bd25-0128ed543065.mp4

Click here for longer video (41.2MB)

The System also offers the transition between Sprinting to Running and Walking when the Sprint key wasn't held long enough to keep performing it.

https://user-images.githubusercontent.com/71723988/163194715-b6e56110-c97f-4617-b9fa-b4552c967443.mp4

Player Rotation

The Player rotates relative to the Camera and the Movement Input.

https://user-images.githubusercontent.com/71723988/163194471-424046dc-4a1c-4d39-8428-9f6d8697b4a2.mp4

Click here for longer video (27.3MB)

Much like in Genshin, it offers an Automatic Rotation in certain situations.

For example, fast pressing (pressing and releasing right away) a movement key will keep rotating the Player until it's looking towards the desired movement direction.

https://user-images.githubusercontent.com/71723988/163194496-f0f58093-ec79-4e7f-a6f9-eb6ac98d1a0b.mp4

Click here for longer video (39.1MB)

Player Dash

The Player can dash up to 2 times (updatable) in less than 1 second (updatable).

If the Player dashes too fast, it will enter a Cooldown (updatable) and the Player will only be able to dash again after that cooldown ends.

https://user-images.githubusercontent.com/71723988/163194734-88f24d93-c15e-4174-884f-c12545caa018.mp4

[Click here for longer video (50.7MB)](https://imgur.com/Z3j

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言