I can’t use « public » anymore

Hello I have a very strange issue,

now if I use « public » I have this error: « error CS1525: Unexpected symbol `public’ »
I created a new project with a simple test script and I have the same problem.

using UnityEngine;
using System.Collections;

public class Test : MonoBehaviour {

    // Use this for initialization
    void Start () {
   
        public float test = 100f;
    }

}

Do you understand why?

Thank you

you don’t use public on variables inside functions…

2 Likes

Oups yeah sorry. Thank you!