I’ve built a function in script A that returns a float value, and now want to set it in script B.
i tried something like this but get a conversion error:
in script B:
private void checkProgress()
{
playerLevel = player.GetComponent(“Stats”).BroadcastMessage(“CheckLevel”, SendMessageOptions.DontRequireReceiver);
}
in script A:
public float CheckLevel()
{
return level; // returns level which is instanced as a public float value;
}
What i’m trying to do with these two functions is check and see if the player has leveled while fighting enemies to eventually scale the enemies to the player to keep the game challenging.