Forum rules - please read before posting.

Camera Movement and Aspect Ratios

Heya!

So I've just discovered that the camera constraints seem to apply to the camera's position, rather than the the camera's viewport? Forgive me if I'm wrong! 

I feel like constraints should test what the camera can see and restrict its movement based on screen edges, rather than position. As I just started up my game in 4:3 (been designing in 16:9) and can't get to the side of my scene.

Thanks!

Comments

  • edited July 2016
    To my knowledge you either have to make it safe for various aspect ratios by designing for 4:3 (the actions happening in the center of your screen) or remove all aspect resolutions of ratios not supported for your build. You can still run the game on a 4:3 screen but will get the widescreen black borders above and below the screen.
  • It's entirely possible to implement your own camera script and integrate it into AC (basically just duplicate the GameCamera2D / GameCamera2DEditor scripts and modify it to suit your needs).  However, you should find that the camera position is consistent for all resolutions provided that you have Force aspect ratio? checked in the Settings Manager.
  • Thanks for the responses folks! Force aspect ratio definitely makes it consistent, but obviously does as advertised, cutting someone's viewport. Part of my want for a scrolling camera is to solve the game working across devices, so everyone gets a full, beautiful image, and can see the whole scene.

    No matter, I did what you said and implemented my own smooth follow camera! I set camera boundaries based on the visible area rather than the camera position. So thanks for the help!
  • I'm want to do exactly what gumboots suggests - have the camera follow to the edges of the scene regardless of screen ratio.

    Unfortunately I'm new to both AC and Unity so if anyone have solved this, could the rest of us also have a look at the solution? Unless I'm missing something this really should be the default setting as forcing the aspect ratio is a very blunt solution for a common problem when targeting different devices.

    Thanks for any help (and to @ChrisIceBox for this incredible plug-in)!
  • Welcome to the community, @kloot.

    Camera limits are dependent on many factors: camera size, shape, distance and FOV all contribute.  I'm not sure that it's possible to provide a built-in option to set a "visual" limit regardless of aspect ratio.

    However, I've posted a script on the community wiki that interpolates camera limits based on pre-defined values when using 16:9 and 4:3 aspect ratios.  You can find it here.

    @gumboots: If you are happy to share your own script, it would be very welcome on the wiki.
  • It works :)
    Thank's a bunch!
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.