calling a booling in c#

A question so basic it's silly that I have to spend such a long time looking for it.(Trust me I've tried)

Ok I got a booleon in one script

public class items : MonoBehaviour {
        public bool item = false;

And I want to call it in this other script

public class Hand : items {

    // Use this for initialization
    void Start () {
        Screen.lockCursor = true;
    }

    // Update is called once per frame
    void Update () {    
    if(item= true){
    Debug .Log ("picked up item");
    if(Input.GetMouseButtonDown(0))
        animation.Play("itemhold");
    }

    }
}

I inherit from the targeted script, but it's not calling. What did I miss? Thanks for your time.

1 Answer

1

syntax error, you have if(item = true).

it should be if(item == true)