Custom viewport navigation

I’m working on an top down game. The best way to edit and work with top down maps would be a function to pan and drag the viewport camera to the part of the map that needs attention, just like dragging the camera in an mobile game. Unfortunately the only way for the editor controls to move on such a xy-plane would be to press the left mouse button and drag forward to dolly and sideways to rotate, but this behavior is not really ideal. So for usability purposes I want to change the default “dolly” behavior and implement a more useful “camera drag” function. I’m sure this can’t be done via plugins and requires engine changes, but for me the benefit it provides would outweigh the inconvenience.

So, my question is this, I’ve dug into the engine a couple times but finding what I’m looking for is still quite difficult. Does anyone know (or have a tip) how I can find the location where viewport camera movement is handled within the editor?

I don’t quite understand why do you find it difficult to pan with your mouse. But anyways, a tip: debug your game (launch trhough VS, not EPIC Launcher) and breakpoint the line of camera movement. When it reaches it, follow it to a journey to the inside of the engine!

Thank you, I was able to find the code and make some adjustments. For anyone else interested, you have to edit the “EditorViewportClient.cpp” file and replace

InDragDelta.X = InDelta.Y * FMath::Cos(ViewRotation.Yaw * PI / 180.f);
InDragDelta.Y = InDelta.Y * FMath::Sin(ViewRotation.Yaw * PI / 180.f);
InRotDelta.Yaw = InDelta.X * ViewportSettings->MouseSensitivty;

with

InDragDelta.X = InDelta.Y * FMath::Cos(ViewRotation.Yaw * PI / 180.f);
InDragDelta.Y = InDelta.Y * FMath::Sin(ViewRotation.Yaw * PI / 180.f);
FVector viewVector = ViewRotation.Vector().RotateAngleAxis(90, FVector(0, 0, 1));
InDragDelta += InDelta.X * viewVector * FVector(1.25f, 1.25f, 0);

That should move the camera in an RTS style. Still wondering if this could be put inside a plugin but it should definitely work for now.

Happy I could have helped! So this is for panning, right?

Right, I simply disable the camera yaw rotation and replace it with the appropriate left-right movement. Since I just edit predefined functions the panning also reacts to camera speeds and such, which is nice