processInput function removed

I noticed that in starting, a function processInput() was created which was being called inside Update() function. That function included the call to Thrust() and Rotate(). But in this lecture i could see that the function was not present in code.
Earlier the code was,

void Update () {
    processInput();
}

private void processInput()
{
        Thrust();
        Rotate();
}

But now it is,

void Update () {
    Thrust();
    Rotate();
}

So, Is it removed for good or will again be reintroduced later?

Hi Dhruv,

It was removed because it’s bad practice to create a chain of methods like this. The processInput method does the same what Update could do, and there is no benefit.

Thanks! Nina. I will remove it from my code too.

I’m glad I was able to help. :slight_smile:


See also:

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

Privacy & Terms