• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Company
  • More Games
  • We’re Hiring!

Food Fight

Conquer the Food Goblin!

  • Home
  • About Us
  • The Game
  • Why it Works
  • Resources
  • News
  • Contact
    • Share Your Feedback!
Home › Development › Visual Indicators

Visual Indicators

Aug 22, 2018 |

Finding a Solution

A requested feature early-on in the FoodFight project was to have visual indicators pointing out where enemies and power-ups are located when they spawn. When it came time to implement them, there were a few things to consider:

  1. In virtual reality, all UI components need to be treated as objects in world space.
  2. Indicators would need to be put in a data container and created/destroyed as needed.
  3. A type of visor would be required that follows the user’s head and moves indicators as needed in real time.
  4. Was there a third party asset that could accomplish this?

Handling UI components in world space is nothing new. The same applies to creating basic data containers to make sure that indicators were spawning correctly. We already had a visor implemented that caused food to splatter when they came close to the player’s face, so maybe we could utilize that? We peaked at the Unity Asset Store to see if there was anything that offered a clean, cheap solution. Lo and behold, we found one. It’s called Off Screen Indicator (OSI) and it also works with virtual reality. Here was our solution, but it still took some work to get it right.

How it Works

On & Off Screen Indicators
Indicators in Food fight

Even though we had a visor and knowledge of world space UI canvases in Unity, there were other challenges involved. We would need a sprite for the indicators. Would they be arrows? Blips? The indicator itself would need to be offset from the user’s point of view. The indicator would also need to rotate to point to the correct position. What is the correct position? The Food Goblin’s legs? Head? Fortunately, these questions were solved with the asset and were built to be togglable from the Inspector window in Unity.

OSI has options for on and off screen indicators, meaning something will pinpoint an object that is already within the player’s view or point towards an object that isn’t. Power-Ups already have a glowing aura around them when they spawn, and Food Goblins stand out extremely well since they contrast with the environment and are large compared to other objects, so on-screen indicators were not needed. Since the player has free positional and rotational movement in VR they can sometimes not realize when an object is not within their view. We use sound effects to alert the player when power-ups or enemies have appeared, but we felt that a UI indicator pointing in the direction of an important object would help them find what they needed quickly without scrambling too much to figure out what was going on. OSI’s “visor” moves with the player and spawns in a list of sprites. Each sprite’s transform is tracked so it can be deleted if the object it is pointing to is deleted. However, we found that the asset wasn’t perfect and that not all transforms would be deleted correctly.

OSI Options with Custom Script

Adjusting for Food Fight

For single objects, OSI would delete their indicator no problem. However, if all objects needed to be wiped due to the player restarting the game they are in or returning to the main menu, the indicators would remain forever on the screen and would spit out an error stating that the object the indicator was tied to could no longer be tracked. OSI saved us a lot of time and headache, but it wasn’t perfect. A script was written to grab a list of all sprite transforms and wipe them before any other objects were deleted.

Finally, all that was left was setting up preferences for the indicators themselves. Indicators were color-coded depending on the object they were pointing at. Green was for power-ups and red for Food Goblins. A glow effect was added to make indicators stand out a bit more on the screen. Next was offsetting them so they weren’t in the middle of the player’s screen and blocking their view. It took some trial and error to find the sweet spot of where to place the indicators, but we settled on having them offset slightly off of the edge of the screen so that they were sort of in the player’s peripheral but didn’t cause their eyes to strain when looking for them.

Conclusion

We needed a proper indication system for Food Fight so that players have a visual cue for the location of power-ups and enemies. It needed to work with virtual reality and spawned on the fly. Off Screen Indicators is a third party asset on the Unity Store that accomplished this, but some additional scripts had to be made to make the asset more flexible for gameplay. However, it saved us much time and effort, because world space canvases make things more complex than a traditional canvas. With this system in place, we now have an indication system that can be edited as we see fit. More indicators can be added that signify more than power-ups or Food Goblins. Additionally, custom sprites can be added, colored, and overlaid with effects as we see fit. It benefits the developers to look at what is available by third-party vendors because you never know when someone has done a majority of the work for you.

You can read more about Food Fight on the game website, or download the game for free on the Oculus store.


Category: Development Tagged: dev-blog virtual reality

About

Health Impact Studio logo

About Health Impact Studio

We are a dedicated team of developers and researchers with the mission to improve the health of individuals through novel technology including games, virtual reality, and role-playing simulations. We welcome input from the full range of stakeholders to create a customer experience with the broadest applicability to improving health outcomes.

Keep Reading

New Update – Food Fight V 1.1 Released!

Jul 01, 2019

Food Fight V 1.0 Released!

Dec 17, 2018

Wrapping Up Development – Part II

Sep 12, 2018

Previous Post: « Tutorial Construction
Next Post: Changing Environmental Graphics »

Primary Sidebar

Food Fight VR for Oculus Rift
Free!Get Food Fight Now!
  • New Update – Food Fight V 1.1 Released!
    Jul 01, 2019
  • Food Fight V 1.0 Released!
    Dec 17, 2018
  • Wrapping Up Development – Part II
    Sep 12, 2018
newsletter

Want to be kept up to date on the latest news?

Get Our Newsletter!

Footer

a product of
Health Impact Studio
a division of Clinical Tools, Inc

Get Food Fight
  • Copyright Guidelines
  • Privacy Policy
  • Terms of Service
  • Technology Requirements
  • 508 Compliance
  • Facebook
  • LinkedIn
  • Twitter
foodfight@healthimpact.studio

101 A Market St Chapel Hill, NC 27516
919-960-8118

We're Hiring!

Join the Development Team!

© 2023 · Clinical Tools, Inc · Log in

Sign Up for Our Newsletter!
  • Hidden

Thanks for signing up!

We’ll keep you up to date on the latest news!

In the meantime…

Check out our other amazing games available on the play store!

Get it on Google Play

And if you played the game…

We appreciate the feedback, it helps us improve our product for gamers to come!

Food Fight Satisfaction Survey