Explaining The Physics Behind Character Controllers - OpenKCC

  Рет қаралды 10,801

Nick Maltbie

Nick Maltbie

Күн бұрын

Пікірлер: 11
@kamigamesofficial
@kamigamesofficial 2 жыл бұрын
Personally my go-to for player controllers (We primarily make fast-paced skill-based games) is a dynamic rigidbody controller, writing code around it to keep full control over what the Unity physics engine is allowed to do to our player at what time. With a bit of work you can make an extremely precise and responsive player controller with this approach, while still having the option of going crazy with dynamic physics related features. Great video, keep it up!
@NickMaltbie
@NickMaltbie 2 жыл бұрын
That sounds like a great design. Is that what you're using for the bullet runner game? I found managing physics objects every physics update to be quite difficult to get them to work properly with other objects in the scene. I found network sync issues with getting physics to line up over the network with dynamic rigid bodies but kinematic didn't run into those issues.
@kamigamesofficial
@kamigamesofficial 2 жыл бұрын
@@NickMaltbie Yes that's how we've set up Bullet Runner :) The approach we take is to add a state machine to the player (e.g. move state, airborne state, receiving knockback state). For movement, instead of using add force we set the x and z velocity directly (with some lerp magic on top), and keep the y velocity the same to keep gravity functional. That way our player can not be pushed around by other objects. When we want to implement e.g. knockback, we either disable the movement code for a short while, and perform an add force, or we add a vector3 force to the movement velocity calculation, that we lerp back to vector3.zero over time. This way you keep a lot of agency over the physics, and the player is snappy, predictable and works well with networking
@NickMaltbie
@NickMaltbie 2 жыл бұрын
That’s a great way to manage the movement and still allow for physics based interactions. I found that kinematic objects felt the most “snappy” but most of my use cases don’t require physics interactions so it would work the same regardless. I still have to switch my project over to a FSM design. I’ll make sure to check out some of your videos in the future, the project looks interesting! I was always frustrated by unity’s non deterministic physics but this seems like a good enough way to get around it. Does that kind of interaction work for other objects pushing the character around as well since you set the player velocity?
@kamigamesofficial
@kamigamesofficial 2 жыл бұрын
@@NickMaltbie Thanks! I appreciate that
@NickMaltbie
@NickMaltbie 2 жыл бұрын
@@kamigamesofficial haha, that’s why I decided to go kinematic character controller because that’s the whole idea of a KCC object. But sometimes you want to be pushed by other objects so it’s hard to say sometimes. Good luck with your project. I’ll make sure to checkout any other videos or updates you post on your channel.
@zabba7461
@zabba7461 3 жыл бұрын
The game footage really helped drive home what you're talking about. Very clearly explained 😭
@MrHumanforlife
@MrHumanforlife 2 жыл бұрын
Subbed man, I really feel a good controller makes or breaks a game. I really hope you go deeper into this subject
@NickMaltbie
@NickMaltbie 2 жыл бұрын
Thanks, I’ll keep making more videos about how character controllers work and about the Open KCC project. I’m working on a video about camera controls now.
@SaadTheGlad
@SaadTheGlad 2 жыл бұрын
Subbed
@NickMaltbie
@NickMaltbie 2 жыл бұрын
Thanks, I’m happy you like the video :)
Why Stairs Suck in Games... and why they don't have to
11:24
Nick Maltbie
Рет қаралды 1,5 МЛН
Lazy days…
00:24
Anwar Jibawi
Рет қаралды 8 МЛН
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 16 МЛН
Мясо вегана? 🧐 @Whatthefshow
01:01
История одного вокалиста
Рет қаралды 3,4 МЛН
You Suck at Showcasing Your Game
28:20
GDC 2025
Рет қаралды 195 М.
How to Move Characters In Unity 3D | Character Controllers Explained
9:46
Making a VIRUS for a Game Jam (and almost winning)
9:36
Deynum Studio
Рет қаралды 337 М.
How Jumps Work - Kinematic Character Controller in Unity
7:30
Nick Maltbie
Рет қаралды 12 М.
The Wonders of Euphoria - Physics in Games
10:41
Cheecken
Рет қаралды 182 М.
Why Test Games
7:28
Nick Maltbie
Рет қаралды 28 М.
The 2018 Failure Workshop
44:06
GDC 2025
Рет қаралды 75 М.
Lazy days…
00:24
Anwar Jibawi
Рет қаралды 8 МЛН