Im trying to call method thats in other script ,
Im trying to do the simple test to see how it works .
FIRST SCRIPT
using UnityEngine;
using System.Collections;
public class koda : MonoBehaviour {
public kodb _kodb;
void Start () {
_kodb.pozvanmetod ();
}
// Update is called once per frame
void Update () {
}
}
int his script Im calling method of other script , other script is kodb and I called varible that I will call it _kodb.
and this is script where method that its calling
using UnityEngine;
using System.Collections;
public class kodb : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void pozvanmetod ()
{
print ("POZVAN");
}
}
this is where my method that Im calling is , but I get error
Object refrence not set an instance of an object , I have both scripts put on two seprate objects .