A bit confused about the parameter rotationThisFrame

Your first two paragraphs are correct. The ApplyRotation method is defined with a parameter (float rotationThisFrame). When we call the ApplyRotation method, we must pass on a value of type float to it.

The method does not return anything because the return type is void. If the return type was, for example, int or string, the method would need the return keyword, and it would have to return an object of the defined type.

We do not output anything in the ApplyRotation method. We just use the parameter like a local variable.


See also:

1 Like