void Start() { controller = GetComponent <Controller2D> (); pivot = GetComponentInChildren <PivotBehaviour> (); gravity = -(2 * maxJumpHeight) / Mathf.Pow(timeToJumpApex, 2); maxJumpVelocity = Mathf.Abs(gravity) * timeToJumpApex; minJumpVelocity = Mathf.Sqrt(2 * Mathf.Abs(gravity) * minJumpHeight); }
void Start() { controller = GetComponent<Controller2D> (); pivot = GetComponentInChildren<PivotBehaviour> (); gravity = -(2 * maxJumpHeight) / Mathf.Pow (timeToJumpApex, 2); maxJumpVelocity = Mathf.Abs(gravity) * timeToJumpApex; minJumpVelocity = Mathf.Sqrt (2 * Mathf.Abs (gravity) * minJumpHeight); }