How to set up an orthographic camera in the editor?

I found that this called from an Widget Utility moves the camera and kind of makes it almost orthographic, though not totally because its still perspective.
This still distorts things that are a bit far away, so its making the development of my 2D isometric game harder.
Is there anything i can do to make the camera in the editor 100% orthographic?


void UGlobalLibraries::MoveCamera(FVector newLocation, FRotator newRotation, float newFoV, ELevelViewportType ViewPortType) {
    FEditorViewportClient* client = (FEditorViewportClient*)(GEditor->GetActiveViewport()->GetClient());

    if (ViewPortType) {
        client->SetViewportType(ViewPortType); //this doesn't work properly
        client->Invalidate();
    }
    client->ViewFOV = newFoV;

    client->SetViewLocation(newLocation);
    client->SetViewRotation(newRotation);
}

This can be called from a BlueprintFunctionLibrary, though needs the module, set in the build.cs:


		if (Target.Type == TargetRules.TargetType.Editor)
		{

			PublicDependencyModuleNames.Add("UnrealEd");
			//also tried  PrivateDependencyModuleNames.Add("UnrealEd");
		}

I tried a bunch of stuff already and i can never get a camera in the editor that matches exactly the isometric level i have.
Perhaps is there a way i can manipulate the level, and design the level, at runtime? Is this possible somehow as a last resort alternative?

Any feedback is greatly appreciated.

Hello Sophia,

Try this:

Place a camera and set its Projection mode to ‘Orthographic’

Go to Window → Viewports, and open Viewport 2

In the ‘Perspective’ dropdown - select your placed camera.

You’ll now have an Orthographic Editor Viewport, but you’ll probably still need to design in a regular viewport (Manipulation widget does not work well in ortho)

1 Like

Awesome !! you have no idea what you saved me from.
I was working in blender to have a proper orthographic view of my project.
What a weight you took off my shoulders.

There is only one problem im not seeing the solution so far, is that i cant move the camera in any way in the editor?
Is there a simple solution to make it happen?
Might be necessary to create a Blueprint utility to control the camera in Editor?

Glad to hear it!

You would need to select and move your created ortho camera by selecting it manually in a ‘Perspective’ viewport.

I could Imagine some sort of utility that could manually tweak camera position. (Nudge x units in 4 directions)