NUI - Overlay

Available as: "NUI Overlay"

Visually overlays the position of tagged entities in-world on to the users screen

Features:

  • Simple set up, easily extendable
  • Overlay specific targets on-screen
  • Show entity name and/or distance to target
  • Set different types of overlay (primary waypoint, secondary targets etc)
  • Sticks to the edge of the screen so you can tell where to look to find them

TO USE:

  • Drag the “NUI Overlay” template onto your User
  • Either add an instance of “NUI Overlay Target Example” to the world
  • Or attach the “NUIOverlayTarget” script to any entity you want to display on-screen
  • You can toggle the “show” property on or off at runtime to show/hide the entity from your overlay

GitHub

4 Likes

UPDATE 1.1

New features:

  • Off-screen edge detection - If a waypoint is off-screen, it will stick to the edge closest to its position, so you know where to look to find it (adapted from @Adam 's work on the Hub tutorial system)
  • Overlay types - Set different overlay types to communicate different levels of information (primary objective, secondary waypoints, points of interest etc)
  • Show distance - Toggle showing the distance to the target
2 Likes

If you use the Package as it is, it’s going to throw a lot of nil value errors on line 51

This can be fixed by adding these lines:

if Entity.IsValid(self:GetEntity():GetPlayer()) then	
	local playerPos = self:GetEntity():GetPlayer():GetPosition()
end

That will get rid of the errors.

Hey Nomaki, it looks like the showDistance property doesn’t work, it makes all the overlay markers disappear if it is set to true