coroutine or update for powerups cooldown
Well, this question has been asked quite often, but i kinda didn't get the answer for what i want from those posts. I want to make a powerup system, where when player object collides with a powerup, the script(powerUpContact) attached to powerup recognizes what powerup it is from a powerUpController script(it has all the details about each powerups length and effects) and calls the powerup effect function. The effect of the powerup should stay for a time and then should be removed. I am using an update method to check till when the powerup effect should occur in the powerUpContact itself. Is using update going to take more resources compared to if i use coroutines? I would also like to know if switching the powerupContact to the player and checking collisions there would help to further increase the performance. Sorry for the bad english and thank you for any help.
sorry the update is called iniside the powerUpController itself.
Your answer
![](https://koobas.hobune.stream/wayback/20220612081948im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Coroutine is called twice less time than update 1 Answer
Execute coroutine in Update() 8 Answers
Is there a way to check something every frame from within a coroutine? 1 Answer
StartCoroutine_Auto_Internal can only be called from the main thread. 0 Answers
What is the best way to loop with very short and accurate interval? 0 Answers