autobzooty / SuperAdventureZero

A "fun" "game" we're "making"
2 stars 0 forks source link

Rebuild character locomotion system #1

Open autobzooty opened 3 years ago

autobzooty commented 3 years ago

Character movement system needs to be redone after Issue #2 is finished.

autobzooty commented 3 years ago

And it goes a little something like this:

function Update() { UpdateRequestedMoveDirection() UpdateSpeed() Move() ResolveCollision() }

autobzooty commented 3 years ago

Building from scratch to reduce complexity and to increase control.

This component will probably be called PlayerMover. It will require a capsule collider and an InputListener. Because we are handling our own collision, a RigidBody shouldn't be necessary.

autobzooty commented 3 years ago

After some experimenting and relearning how this works, I think we want a rigidbody after all. It will handle all of our collision for us in a generic way. However, we should only be using the rigidbody to set the player's velocity once per frame. There is a single authority on how the player should be moving, and it is the PlayerMover component. This will allow us to handle any special movement we want like sidling, bonking, etc.