Identifier expected error

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerStatsController : MonoBehaviour
{
    public static PlayerStatsController intance;
    public int XpMultiply = 1;
    public float XpFirstLevel = 100;
    public float difficultFactor = 1.5f;
    private float xpNextLevel;
    // Start is called before the first frame update
    void Start()
    {
        intance = this;
        DontDestroyOnLoad(gameObject);
        Application.LoadLevel("Gameplay");

        xpNextLevel = XpFirstLevel * (GetCurrentLevel() + 1) * difficultFactor;
        Debug.Log(xpNextLevel);
        PlayerPrefs.DeleteAll();
        AddXp(10);
        Debug.Log(GetCurrentXp());
    }

    // Update is called once per frame
    void Update()
    {
        if(Input.GetKeyDown(KeyCode.A))
        {
            AddXp(100);

        }
        if (Input.GetKeyDown(KeyCode.B))
        {
            PlayerPrefs.DeleteAll();
        }


    }
 
    public static void AddXp(float xpAdd)
    {
        float newXp =  (GetCurrentXp() + xpAdd)*PlayerStatsController.intance.XpMultiply;
        while(newXp > GetNextXp())
        {
         
         
            newXp -= GetNextXp();
            AddLevel();
        }
        PlayerPrefs.SetFloat("currentXp",newXp);
    }
    public static float GetCurrentXp()
    {
        return PlayerPrefs.GetFloat("currentXp");
    }
    public static int GetCurrentLevel()
    {
        return PlayerPrefs.GetInt("currentLevel");

    }
    public static void AddLevel()
    {
        int newLevel = GetCurrentLevel() + 1;
        PlayerPrefs.SetInt("currentLevel", newLevel);
    }
    public static float GetNextXp()
    {
        return PlayerStatsController.intance.XpFirstLevel * (GetCurrentLevel() + 1) * PlayerStatsController.intance.difficultFactor;
    }
    public static TypeCharacter GetTypeCharacter()
    {
        int = typeId = PlayerPrefs.GetInt("TypeCharacter");
        if (typeId == 0)
            return TypeCharacter.Warrior;
     

        else if (TypeId == 1)
            return TypeCharacter.TIBoy;

        else if (typeId == 2)
            return TypeCharacter.Archer;
     
     
        return TypeCharacter.Warrior;
    }
    public static void SetTypeCharacter(TypeCharacter newType)
    {
        PlayerPrefs.SetInt("TypeCharacter", (int)newType);
    }
    void OnGUI()
    {
       GUI.Label(new Rect(0, 0, 200, 50), "CurrentXp = "+GetCurrentXp());
       GUI.Label(new Rect(0, 20, 200, 50), "Current Level = " + GetCurrentLevel());
       GUI.Label(new Rect(0, 40, 200, 50), "Current NextXp = " + GetNextXp());
    }
 
}

Hello I dont know what’s happening, help me please. what shoud i do to fix that?

Copy and paste the actual error message, as it contains more information (such as the line number)

Use code tags when posting code, which will preserve syntax highlighting, indentation, and line numbers, all of which will be necessary to quickly resolve this error.

This error generally means you either have mismatched brackets or parentheses, or you may be missing a semicolon. Very hard to know by just looking, but if we can use the line number, it will point right to it.

1 Like

(75,13): error CS1001: identifier expected

Line 74, remove the first equals sign :slight_smile:

How to understand errors in general:

How to report your problem productively in the Unity3D forums:

http://plbm.com/?p=220