Introduction to =>

First introduction to => in a public variable. Can you explain in a bit more detail? Is it just a short cut method to “public Vector3 GetMovement() { return Vector3.up * verticalMovement; }” - and how does it relate to knockback? Just a way of returning a variable that is used in movement and we do it this way BECAUSE we will do things like knockback?

Hi Clive,

Its literally just shorthand to return the value so that we type less lines and make the code readable.
Its no different that using the code that you place above its just purely readability and a newer way of doing things in C#

Hope this helps

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms