In my game, I am trying to figure out how to have an indicator that points to a specific target or actor. This indication will be called when in proximity of a different actor. I intend on having it connected to the players some how.
(My Example: Base in the middle of the map - Base calls attention when enemy is within X units of Base - Player will see indication sent from Base.)
Would this be something that is a component of the players? Or does this fall into clever HUD UI? Or is is something I’m not even thinking about maybe?
I understand the overlap method, the issue I’m having is understanding the indicator itself, how do I display it? If I use HUD how do I have an arrow point to where the overlap took place? If I should not use HUD, then how would I have an arrow display in the world to show the player where the overlap took place? Also would this arrow need to be some kind of component attached to the player’s actor? or is it something else?
I haven’t done any HUD work yet so I may not be much help.
I don’t think there is a single answer to your question. You could do it a handful of ways.
Anything not in the HUD will basically require you to tether(as a component or otherwise… not sure if component rotation works separately from the root, but either way) it to the player/camera, and then set it’s rotation based on player location, arrow location, and the target location. You could have a simple static mesh as your arrow, maybe even a floating decal?
Then there is the HUD option. I don’t know how to draw the arrow in the HUD, but the rotation calculations should be the same for both methods.
Create a blueprint interface to make your enemies and HUD communicate with each other. Get your enemies to tell your HUD if there is a threat (bool) and the direction of that threat (float - between 0 and 360 to represent the angle). Then get the HUD to draw an arrow material (since you’ll use an arrow texture you’ll need an opacity mask) rotated accordingly with a pivot point of (PivotX,PivotY)=(0.5,0.5).