hey there,
i am currently trying to let my character swim if it is under water. To detect that i thought about theOnControllerColliderHit() function since im using a gamecontroller instead of a rigidbody.
my code looks like this:
void OnControllerColliderHit(ControllerColliderHit hit) {
if (hit.gameObject.tag == "Water") {
isSwimming = true;
}
}
when i apply a collider to the water surface it will detect the collision with the water but the character will of course walk on the water instead of going under it since it is a collider. So what do i have to do?
Thank you!