void Start() { player = GetComponentInParent <KTB_Player>(); inputs = GetComponentInParent <KTB_PlayerInput>(); area = GetComponent <CircleCollider2D>(); gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <KeepTheBroom>(); crosshair = GetComponent <SpriteRenderer>(); rb = GetComponentInParent <Rigidbody2D>(); }
void KnockBack(KTB_Player target) { Vector2 direction = target.transform.position - player.transform.position; direction = direction / direction.magnitude; target.velocity = new Vector2(knockBackForce.x * direction.x, knockBackForce.y); target.knockBacked = true; target.inputIncoming = true; target.knockBackTime = knockBackDuration; }
void Awake() { animator = GetComponent <Animator>(); player = GetComponent <KTB_Player>(); deathGamePlay = GetComponentInChildren <KTB_DeathGamePlay>(); }
public virtual void Start() { player = GetComponentInParent <KTB_Player>(); playersInRange = new List <KTB_Player>(); }