Picking up an object to allow power-up, using external script

I have been searching for a while now, to find out how to make my player transition to a flying mode when picking up an object. This flying mode came with an asset, but unfortunately I cant find a way to transition through the use of the object. In the PowerUp script I want the transition to be for 10 seconds and I realise that Couritine is needed for this, but I want to find out how to the transition first.

Here is the simple PowerUp script:

and here is what i believe to be the relevant part of the flying script:


I would greatly appreciate help, because I am new to C#, thanks.

If I am understanding correctly, the player needs to pick up an object and when the player picks up, you need the player to fly and you need the transition from the normal state to flying state to be 10 seconds?

If so, your current code does not work because of the Update Method in the flying script, as it is still checking for the input.