using System.Collections; using System.Collections.Generic; using UnityEngine; namespace Assets.Scripts.CharacterScripts{ public class WeaponController : MonoBehaviour { public Collider2D playerWeapon; // The collider for the weapon public PlayerController player; // The player public int damage; // The damage we can deal public bool playerAttacks; // Seeing if we're currently attacking or not void Start(){ // Set the damage and whether or not we're attacking damage = player.playerDamage; playerAttacks = player.isAttacking; // Initialize the reference to the player player = GameObject.FindGameObjectWithTag("Player").GetComponent(); } void Update(){ // Continue to update them damage = player.playerDamage; playerAttacks = player.isAttacking; } } }