i was follwing a touorial on making the player swim under water and whilst doing so i found out that calling the character motor script is impossible why is this here is the script
using UnityEngine;
using System.Collections;
public class Swim : MonoBehaviour {
public CharacterController cc;
public charatermotor cm;
void Start ()
{
RenderSettings.fog = false;
RenderSettings.fogColor = new Color(0.0f,0.8f,0.8f,0.5f);
RenderSettings.fogDensity = 0.4f;
}
bool underwater(){
return gameObject.transform.position.y < 58;
}
cc = GameObject.GetComponent <CharacterController>();
cm = GameObject.GetComponent <CharacterMotor>();
}
void Update ()
{
RenderSettings.fog = underwater();
if (underwater){
cm.movement.MaxforwardSpeed = 2;
cm.Movement.MaxSidewaysSpeed = 2;
cm.Movement.MaxBackwardsSpeed = 2;
cm.Movement.MaxFallSpeed = 2;
//if (Input.GetKey(keycode.Space))
}
else
{
cm.movement.MaxforwardSpeed = 6;
cm.Movement.MaxSidewaysSpeed = 6;
cm.Movement.MaxBackwardsSpeed = 6;
cm.Movement.MaxFallSpeed = 20;
}
}
i havent got around to adding the conditions for the input yet so i commented it out
as i said heres the pic confirming that the charactermotor script is active
and heres confiming that its the script was added as a part of the character controller package