Anthony M – Warning and Capture Message Boxes

Today i will be editing current code to include message boxes that pop up when the Seeker is inside.

2017-12-01_11h54_26

Using a similar text from the timer, I made it so that when the game starts it will find the text component under a specific text name and it will automatically be disabled if it is enabled, when the seeker enters the collision box to capture the hider they will be prompted with a message saying that they should grab them.

2017-12-01_11h59_14

Here is when the Seeker is out of the range

2017-12-01_11h59_19

Here is when the Seeker is Within the range to grab.

2017-12-05_10h43_19

For the warning version of the text box I copied the code to find the text box and change the names in various areas ready to be used. I did try to apply it to the Seeker so when the Seeker is within range and detects the Hider then it would display the message, unfortunately the trigger would overlap and cause the capture code to trigger.

So I had to try another method and what I ended up doing was creating a empty game object as a child of the Hider and applied a Collider to it, as well as the code, it ended up working the way I wanted it to.

2017-12-05_10h43_11

This is what it looks like now, the outer Collider is the warning and the inner Collider is the capture area.

2017-12-05_10h45_25

Similar to the capture piece, it only appears when I am within the range.

2017-12-05_11h07_43

Here is what it looks like with both of the triggers active.

Links:

https://answers.unity.com/questions/612234/displaying-text-on-trigger-enter.html

https://answers.unity.com/questions/485667/detect-ontriggerenter-with-tags.html

https://answers.unity.com/questions/1324620/unity-ui-text-enable-and-disable-by-a-c-script-1.html

https://answers.unity.com/questions/170610/multiple-triggers-on-one-object.html

Leave a comment