I’m working on space sim. What I want to happen is, when a missile is shot at your player, I want a GUI to appear and tell you how many seconds before it hits, and if you evade it/get hit by it, I want the GUI to disappear. I’m not asking for anyone to give/write me a script, I’m just asking about how to go about doing it. Thanks.
You put code in OnGUI to do what you describe. There is no special technique relevant to this - just code what you have written in the question. Specifically:
- to make GUI “appear” and “disappear”: draw it or not
- to show a number of seconds: show a label of that number
- to change when hit/evaded: when hit/evaded, change inputs to the script
Your next step should be to code this up, try to get it working. If you then find questions of technique or coding, you can ask those as further specific questions.