#My private Serialize field variable gets me anerror
1 messages · Page 1 of 1 (latest)
The private must come after the [SerializeField]
So [SerializeField] private float spd;
or you can get rid of the private keyword completely, it will have the same effect
[SerializeField] float spd;
I would recommend to always explicitly declare the accessibility of things.
Not at last, because implicit accessibility isn't always the same: Members declared inside types (including other types) will default to private, whereas types declared directly inside namespaces will default to internal.
float and private float are same things
can only be accessed via the script it was written in