I am receiving the Error 0029 on my Boolean ‘inside’, because I’m apparently converting it into a string in my code. What am I doing wrong?
Full Error:
Cannot convert type ‘string’ to 'bool
Code:
using UnityEngine;
using System.Collections;
public class triggerZone : MonoBehaviour {
public AudioClip lockedsound;
public Light doorlight;
public GUIText texthint1;
public static bool inside = true;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter(Collider Col){
if (Col.gameObject.tag = "Player") {
inside = (bool) true;
if (inventory.charge == 4) {
transform.FindChild ("door").SendMessage ("DoorCheck");
if (GameObject.Find ("chargeHUDGUI")) {
Destroy (GameObject.Find ("chargeHUDGUI"));
doorlight.color = Color.green;
}
} else if(inventory.charge > 0 && inventory.charge < 4){
// TextHints.SendMessage("ShowHint" , "I think it needs more power!", UnityEngine.SendMessageOptions);
} else {
AudioSource.PlayClipAtPoint (lockedsound, transform.position);
Col.gameObject.SendMessage("HUDon");
// TextHints.SendMessage("ShowHint" , "This Door is locked, I need to power it!", UnityEngine.SendMessageOptions);
}
}