public void BreakRope() { player.maxDistanceJoint.enabled = false; ropeRenderer.gameObject.SetActive(false); if (head != null) { Destroy(head.gameObject); head = null; } currentAnchor = null; staticRopeHead.gameObject.SetActive(false); }
public void FireRope(Vector3 start) { if (!canFireRope) { return; } if (head != null) { Destroy(head.gameObject); head = null; } target.Show(); emitter.Play(); head = Instantiate(ropeHeadPrefab); head.Init(this, target.transform.position, speed * target.currentDirection, player.ropeMaxDistance); StartCoroutine(WaitForRopeDelay()); }