Trouble setting Time to Wait value in the Inspector

I have several dropper game objects (with Dropper.cs script) in my scene. I want each dropper to drop at a different time, so I set a different Time to Wait value for each dropper object in the Inspector. (The timeToWait variable is serialized.)

I was getting confused because it seemed like the values I was setting in the Inspector weren’t sticking and would keep reverting to earlier values. After trial and error, I found that the only way I could get a Time to Wait value to stick was to set it on one dropper object, hit play, hit stop, then change it on the next dropper object. I had to do them one at time, and always hit play to get the value to stick. If I changed it on all three dropper objects at once, then hit play, the value would only stick on the last object I updated. Is this expected behavior? Thanks for any help!

Hi,

What you sound in your first paragraph sounds correct.

If the values revert themselves, make sure the following is the case:

  • Do not change the values in the Inspector while the game is running.
  • Change the values of the game objects in the Hierarchy, not the value of the prefab in the Assets folder.
  • Do not reset the component in the Inspector.
  • Do not have a firewall or antivirus mess around with Unity.
  • Run Unity on your normal harddrive.
  • Do not save anything in the Desktop folder or elsewhere but on your normal harddrive.

I hope this helped. :slight_smile:


See also:

Hi Nina! Thanks so much for the reply. I followed your tips, and I was able to set the values of Time to Wait and have them stick. But as I played around with different values, I still had a few cases where the values set in the inspector seemed to change back to previous values, or even a case where two objects with different Time to Wait values fell at the same time! I’ll keep an eye on it and see if I can detect a pattern, but for now I’ve been able to set the values where I want them. Thanks again! :grinning:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms