Forum rules - please read before posting.

Character in a 3D sidescroller distorts as he walks to the edge of the screen.

edited October 2019 in Technical Q&A

Hi

I'm trying to make a game using a 3D character, but as a sidescroller. Kind of like in the game Unraveled, or like this video here -

The issue I have is that as soon as I start moving my character in any direction, the character begins to distort like in these images -


I assumed this is a Unity issue but then realized the "follow player" is a AC script and affects how the camera follows the player. While an orthographic camera moves from left to right as it follows the player, the perspective camera just sits at one spot and "turns" left and right to look at the player, which I assume causes this distortion. I am using a gamecamera 2D script. Should I be using a regular gamecamera?

This tutorial here using just Unity doesn't seem to have this issue, and looking at the camera's inspector it looks like the camera's position is changing. In AC, neither the main camera or the gamecamera move, they only turn.

Is this an AC issue, or should I ask on Unity forums? Thanks!

Edit I also attempted using both an ortho cam (for the character) and a perspective cam (for backgrounds) in combination (as for AC here https://adventure-creator.fandom.com/wiki/Sorting_3D_characters_in_2D_scenes) but with that method, camera movements like zooming out etc (using camera: switch) affect only the camera rendering the background, and the player remains the same size, unaffected by the camera switching.

Comments

  • edited October 2019

    I'm not clear on what aspect of your game is in 2D - the video posted above is fully 3D.

    Don't use a GameCamera2D if your environment is in 3D. If it uses Perspective projection, then by design it'll lock the perspective to give a "Ken Burns" effect when scrolling. A regular GameCamera, with its X-axis movement's Affected by field set to Side Scrolling, should do the trick.

    camera movements like zooming out etc (using camera: switch) affect only the camera rendering the background, and the player remains the same size, unaffected by the camera switching.

    I would imagine that's a limitation of the technique, since "Orthographic size" and "Field of View" aren't interchangeable - but you could try altering the script to have e.g. the former be proportional to the latter.

  • edited October 2019

    This is exactly what I was looking for! Sorry, the game started out as 2D, then had some 3D elements added in little by little. In the end all I needed to retain from the 2D game was the sidescroll perspective.

    Been breaking my head over all this for days, but I think I finally might have a solution. It's great that AC has a built in solution for this perspective!

    I would imagine that's a limitation of the technique, since "Orthographic size" and "Field of View" aren't interchangeable - but you could try altering the script to have e.g. the former be proportional to the latter.

    No worries, I don't need that anymore thanks to the Side Scrolling option on the normal GameCamera.

    Thank you, as always :blush:

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.