Answer the question
In order to leave comments, you need to log in
How to call a method from one C# script in another script in Unity?
Unity
has a crypt with a method: public void ShowInterstitial()
I need to call it in another script, in the Die() method,
did I do it right
public GameObject ssilkaNaFirstScript;
private void Die()
{
ssilkaNaFirstScript.GetComponent<FirstScript>().ShowInterstitial();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question