Hi so I’ve been looking through forms all night… and haven’t found something that will work… In EnemyScript i am trying to see if a bool from PlayerScript is false:
EnemyScript:
using UnityEngine;
using System.Collections;
public class EnemyScript : MonoBehaviour
{
public PlayerScript checkDeath;
void Start ()
{
GameObject g = GameObject.FindGameObjectWithTag ("Player");
checkDeath = g.GetComponent<PlayerScript> ();
}
void OnMouseDown ()
{
if (health <=0)
//if the health is 0 or less..
{
if(checkDeath.Dead = false)
//and if the object isn't active..
{
Destroy(gameObject);
}
}
}
I took out the unimportant stuff… but i’m trying to find out if the bool “Dead” from PlayerScript is false… and if it is then to destroy the object…
Im not sure what you need to see from PlayerScript other than the fact that there is a public bool on it… Please help!! thanks!!