I wrote this code in the characterMotor because I am trying to change the gravity of the character when touching water. When I tried pressing the play button this error popped up"Assets/Standard Assets/Character Controllers/Sources/Scripts/CharacterMotor.js(577,10): BCE0089: Type ‘CharacterMotor’ already has a definition for ‘OnControllerColliderHit(UnityEngine.ControllerColliderHit)’ "
Here is my code:
function OnControllerColliderHit(hit:ControllerColliderHit){
if (hit.gameObject.tag == "water"){
Debug.Log("you are changing gravity");
gravity : float = 0;
}else{
gravity : float = 10;
}
}