- Home /
Collectable Hints
Hi
Building an FPS game where it has to walk around looking for objects. I have a lot of objects all over the place on the terrain so is there a way to have the player hit a key like "H" and a hint pops up showing the general area/direction of where the closest collectable is? Some of the collectables are well hidden and I want to offer the player some help in finding the tough ones.
Thanks,
Answer by Julien-Lynge · Apr 27, 2012 at 09:20 PM
Sure, this is eminently doable in Unity. It's really all a question of coding - take the transform of the player, the transform of the object, do a delta on the positions and use this to give a distance and direction.
Take a look at the following in the Unity script reference to get started:
Input
KeyCode
Transform
Vector3
Good luck.
Your answer