How does one use indicators of some sort?


So I’ve got a simple platform game and at some point some meteorites travel in a straight line over the map (if they hit a character X happens). That happens using some simple matinees (movement tracks) that are set to trigger when I need them to and such. The meteorites are initially off-screen.

I want an indicator of some sort to appear Y seconds before the matinee starts playing. Such as an exclamation mark or whatever may be, on the direction the meteorite is coming from. I suppose those markers / indicators will be tied to the camera limits, so that they are always on the left camera edge (limit) for example. Or right, or top or bottom… you guys get it.

Something like this, but indicating prior to the meteorite launching:

Thank you!

This question seems to come up a lot! I guess I should write up a tutorial somewhere. :wink:

Try having a look at this other recent question about almost the same thing, in which I provided an answer that I hope you will find useful now. (You’ll have to scroll down to the part where we start talking about HUD stuff.)

If that doesn’t help you, let me know, and I’ll do my best to try and explain it so everything makes sense.

Hello and sorry for being this late but I’ve been caught up in some other things.

I have looked up on to the thread you provided me with and although things do make somewhat sense to me, I am not really sure I will manage to do this on my own. The question asked in the thread is also a bit different from mine.

I’ve 4 separate objects, call them fireballs that at some point will fly across the screen (matinee movement keys) when triggered.
I want ‘edge of the screen’ arrows or indicators that appear 3 seconds or so prior to the fireballs launching. Each fireball needs an indicator as they come from separate directions.

The game is 2D so that should make it easier, right? Thank you!

I’m thinking about how I can illustrate these ideas best using some generic (non-Blueprint) graphical aids, but for now, let me just describe the most important parts.

Probably the most important node for you to be aware of is the [Project World to Screen][1] node. This node does all the tricky math for us, and ‘converts’ a 3D world position to a 2D screen-space position. (Even though your game is 2D, you’ll still provide a 3D vector into this node — just with one of the axis values always being zero.)

So, whichever actor you want to indicate toward — you’ll use its location vector as the input parameter. You’ll get a screen-space location that represents where that actor currently is on-screen.

Keep in mind that the screen-space output from this node may still be outside of the player’s current view. In other words, the returned screen-space position may be above, below, or to the right or left of what the player can currently see. This means you’ll need to somehow ‘pull’ this off-screen position toward the center of the player’s viewport until it is just within the edge of the screen. The easiest way to do this is by using [Clamp][2] to limit the X and Y components of the screen-space position to within the limits of the screen’s resolution.

The screen’s resolution can be found using the [Get Viewport Size][3] node. The viewport’s DPI will also have to be taken into account.

You can see an example of how Clamp, Get Viewport Size, and DPI scaling come together in this screenshot from the previously linked (other) question:

Hopefully this explains things better!