Can't look around with camera after Eject from Play in Editor

After I hit “Eject” during “Play in Editor”, I can’t look around with LMB or RMB, even though holding down either and using WASD will move the camera around (same with using Q/E and the such to move it up and down).

I am using custom c++ classes for the game logic, most of it based on the StrategyGame example that can be downloaded (including the camera component). The same behavior of not being able to look around after ejecting occurs in the StrategyGame project as well.

Camera movement works perfectly in any viewport outside of the main one after starting Play. Not using the custom game mode and classes will not cause this to happen either.

My question is, what can affect the Editor camera after ejecting in the editor?
If anyone is more familiar with the StrategyGame example, why does it break the camera movement in editor in the main viewport during play (after eject)?

Happened to me too in 4.11.

Maybe this is reason:

“Bugfix: Camera roll is no longer applied to level viewport cameras after ejecting from the player in a PIE session in the existing editor viewport.”

I have temporary fix for engine. Hope it will not break something else.

Open File …\Engine\Source\Runtime\Engine\Private\Slate\SceneViewport.cpp

And insert this to 443 line:

ReplyState.UseHighPrecisionMouseMovement(ViewportWidgetRef);

Code will be look like:

if (World && World->IsGameWorld() && World->GetGameInstance() && World->GetGameInstance()->GetFirstLocalPlayerController())
	{
		bool bShouldShowMouseCursor = World->GetGameInstance()->GetFirstLocalPlayerController()->ShouldShowMouseCursor();
		if (ViewportClient->HideCursorDuringCapture() && bShouldShowMouseCursor)
		{
			bCursorHiddenDueToCapture = true;
			MousePosBeforeHiddenDueToCapture = MousePosition;
		}
		if (bCursorHiddenDueToCapture || !bShouldShowMouseCursor)
		{
			ReplyState.CaptureMouse(ViewportWidgetRef);
			ReplyState.LockMouseToWidget(ViewportWidgetRef);
			ReplyState.UseHighPrecisionMouseMovement(ViewportWidgetRef);
		}
		ReplyState.UseHighPrecisionMouseMovement(ViewportWidgetRef); // <-insert here
	}
	else
	{
		ReplyState.UseHighPrecisionMouseMovement(ViewportWidgetRef);
	}

Hello, thanks for the reply.

I’ve tried the above posted change to the SceneViewport.cpp, however it did not change anything within the editor. (built the code in visual studio and restarted the editor; also built and ran the editor directly from visual studio).

I’ve set up some breakpoints in the code segment, though none of them triggered in Visual Studio while attached to the editor.

Are you using git version of engine or from launcher? If from launcher, you have only one way - waiting for a bugfix from epic themself. Because editing engine from launcher version never changed anything for me.

Or switch to git version.

And I discovered that camera works good in the FPS projects after “eject”. Because bShouldShowMouseCursor (see in code) in shooter is hidden by default, so code execution can get into that “if” branch.

I’ve set up some breakpoints in the code segment, though none of them triggered in Visual Studio while attached to the editor.

If you want set breakpoints into engine code - you must set “Debug Editor” as solution configuration, not “Development…”. Not sure - maybe this enough for launcher engine, or maybe this required git-version too.

I was afraid of that, thanks for the clarification. I am not using the git version, simply the official one.

I will have to wait for a bugfix then. I’m glad it’s nothing within my project code that’s causing this specifically.

Submitted as bug report: Camera rotation broken in PIE(SIE) mode after "eject" when mouse is not hidden - Community & Industry Discussion - Unreal Engine Forums