x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How does one use indicators of some sort?

Hello,

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: https://www.youtube.com/watch?v=vIBHpvRJS74

Thank you!

Product Version: UE 4.17
Tags:
more ▼

asked Jan 23 '19 at 08:37 PM in Blueprint Scripting

avatar image

OutOfRehab
7 1 3 5

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

This question seems to come up a lot! I guess I should write up a tutorial somewhere. ;-)

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.

more ▼

answered Jan 23 '19 at 09:11 PM

avatar image

the_batch
1.1k 4 5 8

avatar image OutOfRehab Jan 29 '19 at 05:16 PM

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!

avatar image the_batch Feb 01 '19 at 05:30 PM

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 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 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 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:

Clamp and GetViewportSize in action

Hopefully this explains things better!

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question