0 votes
by (130 points)
recategorized by

UE4 crashes when playing in editor. Steps to Temp Fix:

Open PXR_HMDFunctionLibrary.cpp

Find Function FPicoXRHMD* UPicoXRHMDFunctionLibrary::GetPicoXRHMD()

Find PXR_LOGE(PxrUnreal, "GetPicoXRHMD Failed!")

Add the line below:
PicoXRHMD = static_cast<FPicoXRHMD*>(GEngine->XRSystem.Get());

Compile with VS.


Bug breakdown - PicoXRHMD is not set in the Editor - nullptr. Causes crash.
Get XR system anyway as a Dev solution.
Assign XR system to Pico HMD variable.

1 Answer

+1 vote
by (55.5k points)

Thank you for your feedback and sharing. We will test this issue.

by (130 points)

Additional info:

"PXR Get Device Model" cannot be used with this temporary fix as it will crash the editor.

I assume some Pico specific functions will be affected. Using a check for WithEditor can get around this.

...