# Getting play area from Orthographic Camera

**URL:** <https://forums.unrealengine.com/t/getting-play-area-from-orthographic-camera/452009>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 10, 2019, 1:19pm UTC](https://forums.unrealengine.com/t/getting-play-area-from-orthographic-camera/452009 "2019-07-10T13:19:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PatangoWango](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PatangoWango](https://forums.unrealengine.com/u/PatangoWango)\
**Post date:** [July 10, 2019, 1:19pm UTC](https://forums.unrealengine.com/t/getting-play-area-from-orthographic-camera/452009/1 "2019-07-10T13:19:42Z")

</div>

I’m a UE4 novice, and have started to learn by creating an “Asteroids” type game.

I’m creating an actor with a CameraComponent:

```
UCLASS()
class ASTEROIDS_API AMyGameCamera : public AActor
{
	GENERATED_BODY()
	
......
protected:
	UPROPERTY(VisibleAnywhere, Category = "Components")
	UCameraComponent* GameCameraComp;
};

```

And setting it up in the constructor thusly:

```
AMyGameCamera::AMyGameCamera()
{
 	// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
	PrimaryActorTick.bCanEverTick = true;

	GameCameraComp = CreateDefaultSubobject<UCameraComponent>(TEXT("GameCameraComp"));
	GameCameraComp->SetProjectionMode(ECameraProjectionMode::Orthographic);
	GameCameraComp->SetOrthoWidth(2048.0f);

	// Origin (0,0,0).
	// Set the camera facing down, so that right & down on screen == +XY respectively!
	SetActorLocation(FVector(0.0f, 0.0f, 2000.0f));
	SetActorRotation(FRotator(-90.0f, -90.0f, 0.0f));

	GameCameraComp->SetupAttachment(RootComponent);
}

```

To get the play area from this camera I’m getting the OrthoWidth and scaling that by the cameras AspectRatio:

```
	FVector2D Result;
	Result.X = GameCameraComp->OrthoWidth;
	Result.Y = Result.X / GameCameraComp->AspectRatio;

```

But it’s not correct, the X (since it’s a parameter) is spot on, but the Y is much larger than it should be, hence my “wrap” function of the the ship has some considerable overlap in the Y axis during play.

Clearly, I’m missing something (that’s probably obvious)…

Does anyone know how to calculate an accurate play area from an orthographic camera?
