I want to display the altitude of the craft on my HUD. or an altitude meter

I have a cockpit type game, and just cant figure out how to get the crafts altitude reading.
Ideally I want it in the traditional sense like a sim with a some kind of Altitude meter bar that scrolls near a triangle Icon but I would also just settle for a Number value.
I intend to have this on an external view hud, cockpit screen and a main HUD like elite dangerous type right in front of the ship.
Whats is the best way to do this.

.examples


v.jpg

For the vertical bars you could shift texture coordinates of a material bound to a widget’s image.

Have a look at this crude example:

  • I used this image:

bars.png

  • In this material:

  • Hooked up to a widget’s image:

  • Widget’s graph constructs a dynamic material instance and binds it as a brush:

The widget’s Tick will modify *vPosOffset *variable and push it to the material’s parameter; the up/down direction is controlled through neg/pos ClimbSpeed var.

End result (it’s smooth in game):

9b37ca9a7daea425213742cd5a8177fc.gif

The blue arrow could be hooked up to a map ranged ClimbSpeed and shifted about in the canvas.

The text, hm, not sure if that’s the best idea but you could have 3 text blocks and map range shift them in the canvas in a similar fashion. You could let them slide off the canvas and ‘disappear’ only to snap them back to the very top/bottom.

WOW Awesome stuff Everynone
I will Totally try this , Just need to get My ships height on the readout . I was wondering if a Line trace to floor would be the right direction.

Only if you are building a ground tracking radar. :slight_smile:
Altimeters usually display altitude above sea level.
So you could simply interpret the craft’s world Z value (in respect to your “sea level” in your map)

Sorry to bother you again Everynone
I have replicated everything in your example widget BP but just cant get the altimeter MID node to the set brush to material node like you have .
What is the Altimeter MID?
Everything I Tried after dynamic material instance to get to the set brush node, does not want to connect .
What did I miss?
Thanks

Thanks Im not really trying to bother with the full on sim of sea level. just looking for a very simple number value of my ships height from the main ground which I could set to zero Z location.

Try dragging a wire off the image rather than the material instance → type SetBrushFromMaterial, and then plug in the the material.

This is what I have got.
But I dont know what the SET node is you created

Right click the Return Value and PromoteToVariable - this will create a reference to the dynamic material you’ve just created.
The SetScalarParam you currently have is used in collections and cannot be used here. Instead, once you have a reference variable, drag a pin off and then Set Scalar Param

It all worked Thanks.
strange that nodes refuse to connect unless I created them directly from the nodes I want them to connect to.(Will have to remember that)
Only issue I have is I cant get the Image to connect to the set brush node .even by pulling it form the pin.keep getting Not compatible with border reference.

AS you can tell I’m still a BP noob

  • seems that your image is actually a border. Double check in the UMG widget.

Ive checked and even deleted it and recreated the Image . but also all my other Images I have said the same thing when I tested them on it .
Strange

OK Found the problem
I tried to connect the image to the dynamic material node parent pin and it said it wasn’t compatible with images .(that told me it sees is as image) so i tried to connect it to the set Brush node again and noticed the node itself was saying that border was not compatible with Image and I figured that the set brush node was the issue . turns out there are 2 types
Image target type and Border target Type , they were named the same and I just chose the wrong one from the list.
got the right one now .
thanks for your help again your a Legend