Brackeys / 2D-Character-Controller

Free 2D Character Controller for Unity.
https://youtu.be/dwcT-Dch0bA
1.16k stars 1.62k forks source link

Serialized fields acting up? #4

Open eliasg13 opened 5 years ago

eliasg13 commented 5 years ago

When using the script as it is provided, the transforms for ceiling and ground checks, as whell as the layer mask return this error from the editor:

Assets\CharacterController2D.cs(11,43): warning CS0649: Field 'CharacterController2D.groundCheck' is never assigned to, and will always have its default value null

Of course, I have already assign them a transform and setted up the layer masks, but, iven when it's shown on the editor, the error persists. This causes the crouchbehaviour to always be activaded.

I have managed to make it work by un-serializing those lines and setting them to public.

Tested on Unity 2018 .3.11f1

I do not know why or what's wrong with the original tho... Cheers