Question by
Tntman93 · Mar 03 at 06:21 AM ·
physicscharactercontrollerwater
Water physics / floating
So this question has probably been asked a million times already, but all the posts I've found about this are either 10 years old or have no answers.
It's pretty simple, I want to be able to float in water, just the basics without diving or anything too complicated yet. What is the best way to do this?
I've tried using:
void OnTriggerEnter()
{
CharacterController controller = player.GetComponent<CharacterController>();
controller.Move(Vector3.up * 10f);
}
But that is obviously not smooth at all, and it's really glitchy.
I read somewhere on an old post that someone used Mathf.moveTowards(), and you could probably use Lerp as well.
Or do I have to switch to rigidbody physics in water? That's fairly easy, but it doesn't seem like it's necessary.
So what is the best way to make smooth water physics? Thanks!
Comment
Your answer