Methods can also have the same four access modifiers that are available to variables, as well as input parameters. Parameters are variable placeholders that can be passed into methods and accessed inside them. The number of input parameters you can use isn't limited, but each one needs to be separated by a comma, show its data type, and have a unique name.
Think of method parameters like variable placeholders whose values can be used inside the method body.
If we apply these options, our updated blueprint will look like this:
accessModifier returnType UniqueName(parameterType parameterName)
{
method body
}
If there is no explicit access modifier, the method defaults to private. A private method, like a private variable, cannot be called from other scripts.
To call a method (meaning to run or execute its instructions), we simply use its name, followed by a pair of parentheses, with or without parameters, and cap it off with a semicolon:
...