void OnTriggerExit2D(Collider2D collider) { hookshot = null; player = null; canSwitch = false; }
void Start() { hookShot = GameObject.Find("player").GetComponent <HookShotScript>(); joint2D = GetComponent <DistanceJoint2D>(); }
void OnTriggerEnter2D(Collider2D collider) { hookshot = collider.GetComponent <HookShotScript> (); player = collider.GetComponent <PlayerScript> (); canSwitch = true; }