I am not sure how to convert this script into c# from js

function DeductPoints (DamageAmount : int) {
    GlobalScore.CurrentScore += 25;
}
void DeductPoints(int Damage)
{
GlobalScore.CurrentScore = 25;
}
using UnityEngine;

public class ZScore25 : MonoBehaviour
{
    void DeductPoints(int Damage)
    {
        GlobalScore.CurrentScore = 25;
    }
}

this came up with a error saying GlobalScore.CurrentScore is inaccessible due to its protection level, do you know how to fix this?

Most likely GlobalScore or CurrentScore is not public. Also why are you passing in Damage but never using it?

2 Likes