Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- else if (other.CompareTag("Pirate Collider") && isPirateCaptured)
- {
- if (shortCollider.bounds.Intersects(other.bounds))
- {
- meanGuy.SetParent(null);
- isPirateCaptured = false;
- meanGuy.GetComponent<PirateController>().PirateSwimingFlee();
- }
- }
- _____________________________________________________
- public void PirateSwimingFlee()
- {
- anim.SetFloat("speed", 0f);
- Vector3 direction = (link.startTransform.position - transform.position).normalized;
- GetComponent<Rigidbody>().AddForce(direction * 500f);
- link = null;
- StartCoroutine(Swimming());
- }
- IEnumerator Swimming()
- {
- yield return new WaitForSeconds(1.5f);
- anim.SetBool("Swimming", true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement