Hello there. I’ve been having some issues with my character controller in a game that I’m making. I’m using a modded version of the default first person character controller, and when I say modded I just adjusted the values of jump height etc, but the overall feel of it isn’t what I want for my game. To be more specific, it feels kind of floaty when jumping, and this is meant to be a 3D platforming game (so I’d desire some more conciseness). For example, when in the air, initial movement isn’t carried over, so when I run and jump I only continue forward if I hold down the forward button while in the air, or else I’ll just drop straight down. To get an idea of what I’m aiming for, a controller system with the feel, or the physics of super meat boy (without wall jumping of course). Also, I’ve noticed that the character tends to slide a little too much after landing, even after I modified the variables to reduce sliding.
If anyone knows of a past/example script that has that same quality of the physics system used in super meat boy, or if you could make a rudimentary script that I could further develop, that would be great! thanks
I’m not going to type up your script for you, but I will say that you will need to investigate applying inertia to your character controller. A rigid body comes with inertia built-in, but it also brings a whole new set of problems, so you’re better off just applying inertia manually to your character controller in the long run.
you need to track your player’s velocity every frame, and know what your player’s maximum velocity is.
while the user is holding down a movement axis, accumulate ‘velocity’ until you reach a maximum value.
when the user isn’t holding down a movement axis, keep applying movement data from velocity and degrade it each frame until your velocity is zero. It is also here in the ‘velocity decay’ that you would apply air or ground friction.
It’s extremely easy to code, which is why I’m not going to bother with handing you a script- if you don’t learn to do this on your own, you’re going to be back here in 15 minutes with other problems. With this info though, you should be able to find exactly the information you need to achieve inertia.
If you want to have a very responsive and feel good character then I suggest you use the character controller and not the rigidbody since you ultimately will want to handle the physics part on your own and not rely 100% on the unity physics.