I understand that you could just use a rigid body, but In the case of a Character Controller on a game object, who might be high in the air, or maybe in water, is there a way to calculate drag and angular drag to make it seem more realistic? Similar to the Rigid body way of calculating it? I understand you could just switch between the Rigid body and Character Controller. However If anyone has a way of using code and applying an equation to the Character, that would be nice to know. I’ve been searching for it and my small brain can’t make sense of a lot of what I’ve read, and I’d be interested in learning more about it.
If you want the most direct, 1:1 recreation of Unity’s Rigidbody (3D) physics, the basic movement is calculated through:
rigidbodyDrag = Mathf.Clamp01(1.0f - (rb.drag * Time.fixedDeltaTime)); // Per FixedUpdate()
// This means that if your drag is equal to the framerate of FixedUpdate(), your object will lose 100% of its speed every frame
velocityPerFrame = lastFrameVelocity + (Physics.gravity * Time.fixedDeltaTime);
velocityPerFrame *= rigidbodyDrag;
positionPerFrame += (velocityPerFrame * Time.fixedDeltaTime);
On the basis that Rigidbody.angularDrag is calculated on the same general basis:
angularDrag = Mathf.Clamp01(1.0f - (rb.angularDrag * Time.fixedDeltaTime));
the same general logic can be applied to it as well, and then applied to the CharacterController's rotation instead.