Forum rules - please read before posting.

Loopable Panoramic 2D Camera

Hello all! 

I've got an interesting situation to see if anyone can help - Basically I'm trying to make some Pannable Panoramic 1st person scenes in my game, much like Callahan's Crosstime Saloon or Goosebumps: Escape from Horrorland.

Now the game is in 2d without a protagonist on the screen - I've set my camera up to pan along with the cursor that works beautifully - However when it comes to reaching the outer edges of the Panoramic shot, I run into difficulities, I was hoping to be able to just move the camera - Teleport to the other side of the picture (I've built some overlap into the image so that I can get a more seamless transition) but the camera doesn't leave the position it's already in.

I figured I could try switching cameras too, but the issue there is that it's only going to be able to loop around once in either direction. 

Anyone got any suggestions?

Thanks <3

Comments

  • You'd need some custom coding, I expect.  A custom camera could do it (see the Manual's Section 4.6), but you may be able to get this with the standard 2D camera with some simple scripting.

    How are you moving the camera normally, and is this an orthographic or a perspective camera?  This'll be easiest to do in orthographic, as that's done by moving the camera in 3D space - perspective does crazy complicated things with projection matrices.

    Moving the camera itself won't work because it's internal record of where it should be is unchanged.  However, I can look into adding a function to the GameCamera2D component that you can use to snap the camera to a given offset.
  • Yeah, I have it set up as orthographic. 

    I'm moving the camera by having it target an empty child I'm calling PanControl and I wrote a script for it's location to update to the location of the mouse's position.

    As for looking into a function where the camera could be snapped to a given offset or movable to a set location in world space would be appreciated so then I could have the shot move when something is updated. Such as if a cut scene was triggered and the camera wasn't in the correct place to see the animation. etc etc.

    I've decided that not being able to pan 360 isn't required since the panning control around the panoramic works effectively. Would have been nice to be able to loop it, but ultimately it's more about the panning then the looping. But not being able to move the camera if required in cut scene is something that is definitely desirable. I can at least have cameras set up for that to switch to and back, but allowing the camera to pan to the location is more eye pleasing.

    Thank you for getting back to me.
  • I'll add such a function, then.  Bear in mind, however, that it'll still be dependent on whatever constrains / position its target takes - so if you don't update the target's position as well, it'll simply move back to where it was before over time.

    If you want a camera to "snap" to it's intended position, such a function already exists: SnapToOffset()
  • I notice in that list that there's an option to Switch Targets - But it's not in the drop down options of the action lists. That would essentially do what I want, wouldn't it? By Switching Targets, it can go to a Marker which I'll have set up, and then afterwards I can set it back to my normal Pancontrol target?

    Are you able to make that part of the drop down, or will I need to get it to call a script to do that instead?

    Thanks.
  • edited April 2017
    You're referring to the script itself?  No, there's no Action to call that directly - but I didn't know enough about the way you've set up your camera to know that would be a solution.  A custom Action could be written to do that - see this tutorial.
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.