Im a making a Clicker Game, and i got it kinda working besides the upgrade part, when i try to get cash from script, i get error
Assets/Scripts/Upgrade_Manager.cs(11,21): error CS1061: Type `Click_Manager' does not contain a definition for `Cash' and no extension method `Cash' of type `Click_Manager' could be found. Are you missing an assembly reference?
Here is my code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Upgrade_Manager : MonoBehaviour
{
public Click_Manager otherScript; //Change the type to the name of the script
void Start()
{
otherScript.Cash = 12; //Setting a variable in otherScript
print(otherScript.Cash); //Getting the value of a variable in otherScript, print was used for demo purposes and is not needed
}
}