So, now we know ther are void methods and return methods.
Is time to talk about PARAMETERS.
What are parameters?

When we create a simple “transform.Translate” and open the first parenthesis, what we can see is this

It opens a little menu above the parentheses with some option, which represent the PARAMETERS of that method.
It means this : when we use a Translate method, inside parentheses we can pass a Vector3, or three different float for every axes, etc.

Parameterized methods can be either VOID or RETURN.
We start with Void to make things easier.
The syntax is the same, what changes is the logic

Now, what we want to do with this method? Sum two numbers, right?
So we have to PASS INSIDE THE PARENTHESES the two number like VARIABLES.

WIth this syntax we create a method which works ONLY if we pass two numbers when we call it.

Why this happened?
Because when we create a methods with parameters, we have to PASS parameters inside.
In this case, we need two INT NUMBERS

If we press Play

In simple terms, the logic of the parameters is simply that of being able to pass variables to the creation of the methods, and pass the VALUES when calling it.

It seems difficult, but with little bit of practice it becomes really easy to use it and understand it!

I use VOID method, but with RETURN method is the same, and change like this

To see the result in the Console, when we call it we insert method in the Debug.Log().

Go to Unity, press Play

There are other things about parameters, but we will talk about in the next articles!

Always in love with programming, even if late (I'm already 39 years old) I decided to follow my dream! We will see how far my passion will take me!