First of all, hi. This is my first post here, if I’m not mistaken.
I’ve dedicated the past few days to learning to use Unity and make a very simple game to practice. Or so I thought I would at first, I’ve been stuck trying to make the player movement work the way I want it to. Tried character controller at first, before realising it doesn’t work well with rigidbodies and has no physics at all besides one sided collisions. When I decided it wasn’t enough, I tried to make rigidbody work, but because I don’t have full control over the player movement it’s been really hard to make it work properly.
I’ll list the requirements I’ve set to myself and I believe the problem will be obvious as you read them.
-
The player can move around until a certain maximum speed, there is acceleration but it’s really fast.
-
The player can be accelerated over that speed by forces other than simple movement, such as being launched or a simple dash that sets velocity to a constant.
-
The player can accelerate mid air, but slower.
-
While mid air, the player velocity is not slowed down.
-
On the ground, the player is quickly slowed down to zero velocity when not pressing anything.
-
The player can interact with rigidbodies and rigidbodies can interact with the player.
-
If the player is standing on a slope, he should of course slide along with it.
In case it wasn’t so obvious, I’m trying to have a controller with velocity controlled by physics and still have a lot of control over it. The way I did it with a character controller was to have two completely separate velocity vectors, one for general velocity and other for movement. The movement one is limited to a certain amount but the other is not limited by anything. You can’t do that with rigidbodies, so my week of pain begun.
I made several versions of the controller, with completely different approaches, but none of them fully met all requirements, or got too close to. I even discovered how bunny hopping works while trying to make this happen. So now I’m on my last hope of understanding a way that this could be done. Searching on the internet only gave me super simple controllers you wouldn’t like in a full game, especially if movement is minimally important in said game.
I don’t care what would needs to be done, the only thing I care about is a FPS controller that feels really good to play. If you know what I’m missing, if there’s a way to make character controller react to physics and slide down slopes, if there’s a way to make rigidbodies super responsive, if I’m not even using the components I should, if you have any kind of theory of how it could work, please tell me.