void Start() { component_CameraLook = transform.GetChild(0).gameObject.GetComponent <FPS_CameraLook>(); component_Jump = GetComponent <FPS_Jump>(); component_Locomotion = GetComponent <FPS_Locomotion>(); component_Crouch = GetComponent <FPS_Crouch>(); }
void Awake() { fps_camera = transform.GetChild(0).gameObject; //assign player's first child as a camera currentSpeed = walkSpeed; //because the game has just started set current speed to the walk speed //start assigning Component Calls to RigidbodyModule = GetComponent <Rigidbody>(); JumpModule = GetComponent <FPS_Jump>(); CrouchModule = GetComponent <FPS_Crouch>(); ClimbModule = GetComponent <FPS_Climb>(); CameraModule = fps_camera.GetComponent <FPS_CameraLook>(); //check whether or not scripts are missing. features are going to be disabled accordingly jumpEnabled = (JumpModule != null); crouchEnabled = (CrouchModule != null); climbEnabled = (ClimbModule != null); }