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!
@NickMaltbie2 жыл бұрын
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.
@kamigamesofficial2 жыл бұрын
@@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
@NickMaltbie2 жыл бұрын
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?
@kamigamesofficial2 жыл бұрын
@@NickMaltbie Thanks! I appreciate that
@NickMaltbie2 жыл бұрын
@@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.
@zabba74613 жыл бұрын
The game footage really helped drive home what you're talking about. Very clearly explained 😭
@MrHumanforlife2 жыл бұрын
Subbed man, I really feel a good controller makes or breaks a game. I really hope you go deeper into this subject
@NickMaltbie2 жыл бұрын
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.