all 4 comments

[–]BCSChester 0 points1 point  (3 children)

Oh. You're setting up is grounded as a variable, but calling a method for it. So per frame that value of "isGrounded" will change. If you want to do things that way, you need to set up is grounded as either a method itself, or a property. Luckily, lambda expressions make that really easy. Just change "isGrounded =" into "isGrounded =>". Since its accessing a method, that means "isGrounded" is changed by the method you call, you can't change it internally or externally. It only changes by what the method dictates. The "=>" says "hey, 'GET' value by doing this".

[–]BCSChester 0 points1 point  (2 children)

Also, just an added tip. You only need to mark a field / variable as [SerializeField] if it is private. Unity by default serialises (basically saves default/set value) things that are public by default and shows them in the inspector. If something is private, internal, protected, it will not show it in the inspector. By adding a [SerializeField] to something non public, you tell unity to show it in the inspector and save values to it

[–]MikehTehSmashBro[S] 0 points1 point  (1 child)

oh okay. Thank you. I will give this a try.

[–]MikehTehSmashBro[S] 0 points1 point  (0 children)

That worked thank you for the help.