☄️Tips & Code Examples
v1.0
Last updated
v1.0
Last updated
OverlayIcon
at RuntimeIf you're customizing things, such as adding a UI Health Bar to your icons, you may need to access the OverlayIcon
component at runtime associated with your object, but it won't be created until the game starts.
We can use a coroutine to grab this just a couple frames after Start()
. You can also do additional logic and plumbing at that point as well.
Assuming you have access to the OverlayIcon
as shown above, you can get the distance to the target. Additional members can be found on the Overlay Icon page.
The OverlayIcon
handles both screen and edge overlay, and there's a period between the two where it will transition.