"The type or namespace name "Key1Trigger" could not be found?"

using UnityEngine;
using System.Collections;

public class DoorScript : MonoBehaviour {
public Key1Trigger KeyScript;
// Use this for initialization
void Start () {
gameObject.renderer.material.color = Color.red;
Key1Trigger= GetComponent();

}

// Update is called once per frame
void Update () {
if (Key1Trigger) {
Debug.Log (“Trigger Activated”);
}
}
}

use code tags please

This looks to be C#. If that’s so then…

in this line:

public Key1Trigger KeyScript;

Which is the type, and which is the name of the variable?

In C# the type must come first. The name of variable after that.

But here you treat the type as the variable name:

Key1Trigger= GetComponent<KeyScript>();

and here:

if (Key1Trigger) {

KeyTrigger1 is a bool from another script, keyscript

Huh?

Then you have your variable set up way wrong.

It should be something like this:

using UnityEngine;
using System.Collections;

public class DoorScript : MonoBehaviour {
    public KeyScript _keyScript;
    // Use this for initialization
    void Start () {
        gameObject.renderer.material.color = Color.red;
        _keyScript = GetComponent<KeyScript>();
    }

    // Update is called once per frame
    void Update () {
        if (_keyScript.Key1Trigger) {
            Debug.Log ("Trigger Activated");
        }
    }
}

Why have you put two different kind of keyscripts?