in my score script I have this variable public int heightScore; I wanted to make the variable heightScore my players Y position. heightScore = int.Parse(player.position.y.ToString("0")); and it worked but now I want to make another variable in another c# file the same as my heightScore. so I thought I make this: public Score theHeightScore; and my other variable like this: public int coinsGet; and just make them the same like this: (this is also the line that gives the error) coinsGet = theHeightScore.heightScore.ToString("0"); but if I go back to unity it gives me this error: Assets\Scripts\CoinsCollect.cs(16,20): error CS0029: Cannot implicitly convert type 'string' to 'int'
can someone explain to me how I can fix this?
thank you!