# World Order ( Grenade Indication)

**URL:** <https://discussions.unity.com/t/world-order-grenade-indication/646168>\
**Category:** Scripting\
**Tags:** Scripting\
**Created:** [November 17, 2016, 6:40am UTC](https://discussions.unity.com/t/world-order-grenade-indication/646168 "2016-11-17T06:40:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edition-Studio](https://avatars.discourse-cdn.com/v4/letter/e/439d5e/32.png) [@Edition-Studio](https://discussions.unity.com/u/Edition-Studio)\
**Post date:** [November 17, 2016, 6:40am UTC](https://discussions.unity.com/t/world-order-grenade-indication/646168/1 "2016-11-17T06:40:45Z")

</div>

How would one go about creating such a script to notify a player if a grenade is close and ready to explode.

---

<div class="post-metadata">

**Author:** ![Lethn](https://dub1.discourse-cdn.com/unity/user_avatar/discussions.unity.com/lethn/32/386802_2.png) [@Lethn](https://discussions.unity.com/u/Lethn)\
**Post date:** [November 17, 2016, 11:49am UTC](https://discussions.unity.com/t/world-order-grenade-indication/646168/2 "2016-11-17T11:49:30Z")

</div>

A trigger collider would probably work well here, create a sphere collider around the player and then have it search for a grenade tag perhaps, for the grenade icon like you see in multiplayer shooters you could make use of the worldspace canvas and attach that to the grenade object itself and have it activate when grenade enters the sphere. You could have the worldspace canvas attached to the grenade constantly and just hide it until it’s needed and then it will destroy itself along with the genade gameobject after it’s done exploding because it will be a child of the grenade gameobject.

Check out collider and activation tutorials for how to do it.

[![](https://europe1.discourse-cdn.com/unity/original/4X/a/4/0/a405fb25c0c40a4b8c30d2c6f2395b7be66b23e8.jpeg "Activating GameObjects - Unity Official Tutorials") ](https://www.youtube.com/watch?v=Vfr5B8rw868)

[![](https://europe1.discourse-cdn.com/unity/original/4X/d/d/4/dd4774079fa09c27b870d9830e6505547832c202.jpeg "Colliders as Triggers - Unity Official Tutorials") ](https://www.youtube.com/watch?v=m0fjrQkaES4)

Here’s a worldpsace canvas tutorial too.

[![](https://europe1.discourse-cdn.com/unity/original/4X/4/d/5/4d5e5d37f457efd5e1aedc16710a866acd3c6c1f.jpeg "Unity 4.6 - New UI World Space Canvas") ](https://www.youtube.com/watch?v=Mzt1rEEdeOI)

If you want to just simply flash a text message up, then you won’t need worldspace and can simply activate the text when the collider is triggered.

---

<div class="post-metadata">

**Author:** ![LeftyRighty](https://avatars.discourse-cdn.com/v4/letter/l/e19adc/32.png) [@LeftyRighty](https://discussions.unity.com/u/LeftyRighty)\
**Post date:** [November 17, 2016, 11:57am UTC](https://discussions.unity.com/t/world-order-grenade-indication/646168/3 "2016-11-17T11:57:07Z")

</div>

> [@Lethn](#):
>
> and then have it search for a grenade tag perhaps

as an extension once you’ve got the basic premise working; you might consider an Interface so you can use the same setup to handle any “threats”, grenades/bombs/environmentalEffects/whatever.

---

<div class="post-metadata">

**Author:** ![Velocity\_Studio](https://avatars.discourse-cdn.com/v4/letter/v/e47774/32.png) [@Velocity\_Studio](https://discussions.unity.com/u/Velocity_Studio)\
**Post date:** [December 6, 2016, 4:45pm UTC](https://discussions.unity.com/t/world-order-grenade-indication/646168/4 "2016-12-06T16:45:34Z")

</div>

Thank you very much. You guys will be given credit in the game.

---

<div class="post-metadata">

**Author:** ![Edition-Studio](https://avatars.discourse-cdn.com/v4/letter/e/439d5e/32.png) [@Edition-Studio](https://discussions.unity.com/u/Edition-Studio)\
**Post date:** [December 6, 2016, 4:50pm UTC](https://discussions.unity.com/t/world-order-grenade-indication/646168/5 "2016-12-06T16:50:24Z")

</div>

> [@Velocity\_Studio](#):
>
> Thank you very much. You guys will be given credit in the game.

Sorry i loged in wrong account there. ☹
