I am trying to call a function of a different C# script from within another C# script.
This is what I am trying to do here:
GameObject.Find("Player").GetComponent("FireScript").PowerUpLaser();
Basically, there’s a function known as “PowerUpLaser” inside FireScript.cs which I am trying to access from inside another script. This works fine in JavaScript but throws me the following error when I tried the same syntax in C#.
error CS0117: `UnityEngine.Component' does not contain a definition for "PowerUpLaser".
Any idea where I am going wrong?
Thanks!