How to make a message box

Updated on January 11, 2017 in [A] Unity Scripting
Share on Facebook0Tweet about this on Twitter0Share on Google+0Share on Reddit0
11 on January 10, 2017

I want to make a message box so if i press esc it will show to confirm on exit app. But i dont know how to make it. Its ok if you just give me a tutorial link video.

*sorry for my bad english.
*any help will appreciate

  • Liked by
Reply
1 on January 10, 2017

Please never make a full caps title and fill that with question marks, it’s only annoying.
I changed it for you this time but make sure you don’t do it.
 
As well as make sure to select the right category, the challenge category is when you have something that could be challenging for someone else to make.

on January 10, 2017

sorry.. i dont know that..
won’t do that again

Show more replies
  • Liked by
Reply
Cancel
3 on January 11, 2017

I would simply make a canvas and in the script toggle it on or off.

on January 11, 2017

Thanks for your answer, i will try it

Wise
on January 11, 2017

If you need more help, I could explain how you would make the canvas and write the script.

on January 11, 2017

of course. i will be happy if you want to explain it to me.

Show more replies
  • Liked by
Reply
Cancel
0 on January 11, 2017

Create a new canvas, you can add whatever you want there, buttons, text, panels.
On an empty game object add a new script, I called it ExitMenu. In the script you write this:
http://pastebin.com/DJahJ7kL
I commented out the code so it is easier to understand.
Now lastly select the empty game object with the script attached and drag in the canvas game object into the inspector where it is specified.

I made it so when you press escape it will toggle the canvas on or off.

https://imgur.com/a/0Ue1X

  • Liked by
Reply
Cancel
3 on January 11, 2017

Thank you very much.. i’ll try it my self

Wise
on January 11, 2017

Let me now if you made it to work.

on January 11, 2017

its totally work.. Thank you very much for helping me.. 

Wise
on January 11, 2017

No problem.

Show more replies
  • Liked by
Reply
Cancel