Yeah i usually just attach the script to more than one gameObject
Here's the code: https://drive.google.com/file/d/1w7wA0ZgzTczIuiYd-LKEi-o3tQZGH81e/view?usp=shari...
It's a UnityPackage
Explanations are in the code as comments, if you need help with any other code, just ask. There are two scripts, and both of them are needed, if you need help setting it up, I can record my screen and send you the video. :)