private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { PlayerPlatformer player = collision.GetComponent <PlayerPlatformer>(); if (player) { player.SetJump(1.5f); } } }
private void FixedUpdate() { //if (Mathf.Abs(horizontalInput) > 0.9f) //{ // controller.UpdateFacingDirection(horizontalInput > 0 ? true : false); //} if (zipline) { m_rigidbody.velocity = zipline.Movement(); } Vector3 diff = (zipline.targetPosition - transform.position).normalized; if ((zipline.Movement() + diff).magnitude < zipline.Movement().magnitude) { controller.SetJump(); } }