Best way to set up a simple 2D project

I’m going to have a game that’s just a 2D presentation, and there isn’t actually a physical character. Starting with the 2D platformer code template is handy as it already defines a character that has a camera with an orthographic projection. Thing is, I’m not actually going to have a visible player in the game, nor is there going to be one moving around. It’s essentially going to just be a series of interactive screens (like how say chess or a card game doesn’t have a player character moving about). I could start with that template and just rip things out, leaving my player class with just the camera and boom so that it gets displayed correctly, and so I can deal with handling user input, but is that really ideal? Or is there a simpler, better way I should do this? I thought about having a totally blank project and just dragging a camera object in, but I couldn’t seem to figure out how to make that camera be the default/main one used. Thanks for the help.

If it’s just interactive 2D screens, why did you decide to go with UE4? I think something along the lines of flash would be more suited to your needs. Because right now you’re bending UE4 to do something which it probably isn’t meant to do.
Anyways, if you still want to go down that path, leaving your player class with just a camera is probably the easiest way to do so. In your project you would have to set up your different scenes at different coordinates and then position your camera in your code whenever the current scene is done.

Hi Architekt,

There’s a lot of flexibility in camera and input control, which lets you solve the problem in many different ways but conversely makes it hard to find a ‘golden path’. You can have a look at something like the Puzzle template to see how it handles cameras or you can do as you suggested and just remove the sprite from the player character, and teleport it to your different scenes. Another approach is to just use placed camera actors, with a bit of level script or player controller logic in order to switch between them. To do this, you’d place one or more camera components, and then call SetViewTargetWithBlend on GetPlayerController 0 in order to activate them.

In 4.4 we’ll actually have a new option on camera actors that let them automatically take control of the view when play begins, which should make really simple setups easier to manage, with no worry about a pawn or separate camera component. If you have multiple cameras you’d still need to switch between them, but you could also just move the single camera around instead.

Cheers,
Michael Noland