private void OnControllerColliderHit(ControllerColliderHit collider) { if (collider.gameObject.tag == "Button") { ButtonObject thisButton = (ButtonObject)collider.gameObject.GetComponent(typeof(ButtonObject)); if (thisButton.getStartingOrientation() == gravityDirection) { thisButton.setBeingPressed(true); } } else if (collider.transform.tag == "Jump Pad") { usingLaunchPad = true; launchStrength = collider.gameObject.GetComponent <JumpPadObject> ().launchStrength; } }