Hello, I’m experiencing a lot of trouble with player controls, and what the best method is to use.
I’ll start off by saying I cannot use the Character Controller for my needs, as my player character has functional elements attached that require multiple colliders. As Character Controllers can’t seem to work with multiple colliders (to the best of my knowledge), it’s unfortunately out of the question. As such, I’m stuck using a Rigidbody-based controller, and this is where my problem begins.
I’ve been researching this for a long time, hoping to figure this out, but I have found a lot of conflicting information about this. To start, I know that you should not modify rigidbody.velocity directly, as it makes physics unrealistic, and also causes issues with gravity. I also know that transform.position is teleporting - so player collisions can potentially clip through in various scenarios. I’ve tried rigidbody.MovePosition, and it works perfectly, EXCEPT that I am also aware that it does teleporting exactly like transform.position setting, since the rigidbody is non-kinematic.
So, right now, when I use rigidbody.MovePosition (which is my most-functional attempt), some collisions are not an issue, but with smaller colliders, or when the player is going at a high enough speed, there’s a good chance the player character is going to go straight through something. I am aware this is because of the teleporting aspect of non-kinematic rigidbody-based MovePosition, and that’s given me some serious problems. Because of this, I question MovePosition’s usefulness, since to my knowledge, while smooth transitions are useful for kinematic rigidbodies, it’s also important for non-kinematic ones, so I fail to see why MovePosition’s behavior on non-kinematic rigidbodes is good in any respect. Wouldn’t it be useful if MovePosition worked the same way with both kinematic and non-kinematic rigidbodies? Am I missing something here?
And finally, I’ve been working with rigidbody.AddForce and rigidbody.AddRelativeForce. I’ve had a lot of trouble figuring these particular methods out. Most of the time, the character either doesn’t move at all, or it rockets off at insane speeds. I’ve gotten something partially working since, but it is very unstable. I based it off of some FPS controller that went in four directions, but I wanted it to work only in forward/backward directions with steering (car-based), and my changes aren’t perfect. For one thing, it zooms off if it faces a certain direction, and regardless, fails to go up slopes at all. I believe it relates to gravity when trying to go up a ramp.
Ultimately, what I’m asking for here is to get some direction as to the best way to approach making a rigidbody-based controller (NOT a Character Controller one, as it does not fit my needs, unfortunately). I’ve seen a lot of different options, and a lot of reasons why each doesn’t work. And so I am at a loss. Is anyone willing to provide some insight?