I’m looking to have a gui that I can start, adjust some inputs and start over. I’m not really making a game so much as an interactive visualization. Basically I adjust some parameters (speed, wave height, etc.) and the hit play. Next there’ll be my boat rocking w/ the waves according to those inputs. Then if I hit pause I can reset some parameters and play the new setting.
Time.timeScale = 0.00001 ; That will ‘pause’ the game, yet allow UI to be played with.
I’ve got a looping wave that travels across a plane. This wave is to show a wave hitting a ship at different angles. It starts and restarts continuously but if I change the angle of attack something in the math is off and the whole thing goes haywire. If I just run the program w/o changing variables it works fine. It’s really difficult to figure out what’s happening w/o decent troubleshooting for the script (something I’ve heard Unity 3 has but I certainly hope it’s not just the pro version). The reason I’m trying to start stop is because I can’t get my wave to update properly for different angles. If I plug in a slow time value I still have problems. Is there a way to reset time to 0 on a button click? This would work just as well.
unity Gui works even if Time.timeScale is set to 0
you can make your objects respond to a boolean like isPaused and hit some key, makes it true or false, and the objects only update if isPaused is false, also you can set timeScale to 0 and reset it to 1 or whatever the value you need with a gui button, as i said, gui responds even if timeScale is set to 0,
you can pause, set isPaused to true and timeScale to 0, and a gui comes up with parameters yo can adjust, and when you resume from pause, you feed the parameters to the objects before exiting pause, and then resume timeScale to 1 and isPaused to false and the objects should now update with new parameters
if there is some rigidbody you want to reset, you can always set to 0 the rigidbody’s velocity and angular velocity when paused, so when it resumes, it no longer has the forces it had before pausing
hope this helps 8)