Using a button to set a Script as Active or Inactive
Hello, I'm using a button to "pause" a spinning radar line. I find that by activating and deactivating the script that runs the speed of the radar spin, I can pause the line, as well as resume it and the speed it was left at. (I'm checking and unchecking the Script component to activate and deactivate, simulating the process I want the button to achieve.)
I can stop and freeze the radar by using a button that sets the speed variable to zero - but this cannot be easily resumed to the previous speed (in any way that I know of.)
Also, not looking to pause the time of the gameplay either, as other processes continue when the radar line pauses.
Your answer
![](https://koobas.hobune.stream/wayback/20220612125536im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
gameObject.SetActive (false); not working 2 Answers
Hide/Unhide Canvas in AR Project 0 Answers
Script to random set active a child object? 0 Answers