1. Home
  2. UE5 Compilation Errors
  3. UE5 C++ Compilation Error...
  4. Compilation Error: Could Not Find a Function Named ‘IsHeadMountedDisplayEnabled’ in ‘FirstPersonHUD’

Compilation Error: Could Not Find a Function Named ‘IsHeadMountedDisplayEnabled’ in ‘FirstPersonHUD’

Why You’re Seeing This Error

This error means the Blueprint is trying to call a function that doesn’t exist on the target object or class — in this case, it’s looking for IsHeadMountedDisplayEnabled on FirstPersonHUD, but that function either:

  • Doesn’t exist in that Blueprint or class
  • Was renamed, deleted, or moved to another class
  • Was originally inherited but the parent has changed
  • Is a C++ or engine function being called on the wrong type of object

💥 Example Error Message

Could not find a function named 'IsHeadMountedDisplayEnabled' in 'FirstPersonHUD'

🛠️ Common Blueprint Scenario

Get (FirstPersonHUD) → Call Function: IsHeadMountedDisplayEnabled

But FirstPersonHUD does not define or inherit this function — result: ❌ Compilation error.


✅ How to Fix It in UE5 – Step-by-Step


✔️ 1. Make Sure You’re Calling the Function on the Right Object

IsHeadMountedDisplayEnabled is part of the "HeadMountedDisplayFunctionLibrary"

It’s not a function that lives on HUD or PlayerController by default.

Fix:

Call Function: Is Head Mounted Display Enabled (from HeadMountedDisplayFunctionLibrary)

No need to call it from your HUD — it’s a global (static) function.


✔️ 2. Replace the Call with the Correct Node

Delete the bad call → Right-click → Search "Is Head Mounted Display Enabled"
→ Choose the node from the correct library

The correct version does not need a target pin — it’s a pure function.


✔️ 3. If You Intend to Add That Function to FirstPersonHUD, Define It

If you really want FirstPersonHUD to have that function:

- Open FirstPersonHUD
- Create a custom function called "IsHeadMountedDisplayEnabled"
- Add your desired logic or call the library function internally

✅ Summary: How to Fix “Could Not Find a Function Named ‘IsHeadMountedDisplayEnabled’” in UE5

CauseFix
Calling function on the wrong objectUse the version from HeadMountedDisplayFunctionLibrary
Function was renamed or deletedRecreate or reassign the correct function call
Intended to be local but isn’tDefine the function inside FirstPersonHUD manually if needed
Was this article helpful to you? Yes No

How can we help?