private void Awake() { player = GameObject.FindGameObjectWithTag("Player").transform; playerHeath = player.GetComponent <PlayerHeath>(); enemyHealth = GetComponent <EnemyHealth>(); nav = GetComponent <NavMeshAgent>(); }
void Start() { target = GameObject.FindGameObjectWithTag("Player").GetComponent <Transform>(); playerHealth = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerHeath>(); transform.LookAt(target.position); transform.Rotate(new Vector3(0, -90, -90), Space.Self); //Destroy(gameObject, lifetime); ??? }
private void Awake() { animator = GetComponent <Animator>(); playerHealth = GetComponent <PlayerHeath>(); playerTail = GetComponentInChildren <TrailRenderer>(); prevJumpAmount = jumpAmout; _controller = GetComponent <CharacterController>(); oldSpeed = speed; oldGravity = gravity; oldJumpAmout = jumpAmout; sceneManager = FindObjectOfType <SceneManager>(); LoadPlayer(); }
private void Start() { playerHeath = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerHeath>(); Deathscreen.SetActive(false); }
void Awake() { playerHealth = FindObjectOfType <PlayerHeath>(); }
private void Start() { playerHealth = PlayerBaseClass.current.playerHealth; }
// Use this for initialization void Awake() { player = GameObject.FindGameObjectWithTag("Player"); playerHeath = player.GetComponent <PlayerHeath>(); anim = GetComponent <Animator>(); }