Pulling Object Roll Angle and displaying it in HUD

I have a ship on the ocean and want to display the Local Y Axis Rotation of the ship to the HUD. Any help on how I would do this is much appreciated.

To display the local Y-axis rotation of the ship on the HUD in Unreal Engine, you can start by accessing the ship’s rotation. The rotation is represented as a Rotator, which has Pitch, Yaw, and Roll components. Since the Y-axis rotation is typically reflected in the Yaw value, you’ll extract this using the Get Actor Rotation node followed by a Break Rotator node. Once you have the Yaw value, you can process it if needed, such as rounding or formatting it for clarity.

Next, create a widget blueprint for your HUD. Inside the widget, add a Text block to display the rotation. Use the widget’s binding capabilities to dynamically fetch the ship’s Yaw value. For instance, you can reference the ship’s blueprint to get the current rotation and update the widget’s Text property with the Yaw value.

Finally, ensure the widget appears on-screen. In your ship’s blueprint or game mode, add logic to create the widget at runtime using the Create Widget node and attach it to the viewport using Add to Viewport. With these steps, the local Y-axis rotation of the ship will be displayed and updated dynamically in the HUD.

THANKS! I think I understand… Just not sure which BP to do the Get Actor Rotation and Break Rotator in… I have these two BPs

This one has the Add to Viewport Node was just out of frame

The best place to perform the Get Actor Rotation and Break Rotator operations depends on your game setup. If the ship is the central focus and directly controls its display data, handling this logic in the ship’s Blueprint is simpler. The boat already has direct access to its rotation, so you can use the Get Actor Rotation node there, extract the Yaw value with a Break Rotator node, and pass the result to the HUD widget through a variable or function. However, if your HUD or Player Controller is designed to manage multiple actors or centralized game information, you can handle the rotation logic there instead. In this case, you would reference the ship actor in the HUD or Player Controller, fetch its rotation, and update the HUD widget dynamically. This approach is useful if the HUD needs to track multiple objects or if the player doesn’t always directly control the ship.

Hope this helps