0 Favourites

Zoned-Restricted Camera Following

  • Does anybody know how to make a camera like this except have it been transition-less?

    I've got most of my game set up except for enemies, structure of the map and the camera.

    The camera in the tutorial follows the player within the zone, and makes a smooth, quick transition switching to the adjacent zone when the player enters a new zone.

    I need the camera to focus on the player and have the player in the centre at all times, not leave the borders of the zone sprite but able to pass into the cross borders of one zone partially into the other zone so that the player stays inside the camera centre instead of it "jumping" into the other zone.

    Any idea how to set that up?

  • Whoops. This topic made me realized that I hadn't replied back to your last PM. Sorry about that.

    The capx is attached. It contains a "ZoneConnect" sprite. Basically, when the player overlaps a ZoneConnect , the camera will look at any Zones overlapping the ZoneConnect , and treat them as one big zone. Getting everything to transition smoothly takes some fine tuning of the size and position of the ZoneConnect sprites. Also, as I mentioned before, corners are always the biggest issue with camera systems like this.

    For anyone wondering what I'm talking about, here's a demo I had previously sent Nestris:

    ZoneBasedCameraV2

  • zatyka

    No problem, thanks for the .capx! I actually thought I was bothering you so I didn't send any further PMs. lol

    As fort he corners, I noticed that the "ZoneConnect" sprites were huge, after playing around with them I noticed what you mean by fine tuning them for a smooth transition.

    Is it possible to put the ZoneConnections between the zones instead of on top of them and get a better transition?

    I noticed that if you make the "ZoneConnect" overlap as much as they can, you get completely seamless transitions.

    Would there be a way to keep this, but just always have the character completely in the centre of focus? So the camera doesn't pan, just keeps focus on the player and is still on these "rails"?

    I'm going to give a try in my game and I'll put up a preview thingy html if I can so you can give it a play

  • [quote:3ts75lnl]Is it possible to put the ZoneConnections between the zones instead of on top of them and get a better transition?

    Not with what I've built. The entire system is based on the sprites overlapping.

    [quote:3ts75lnl]I noticed that if you make the "ZoneConnect" overlap as much as they can, you get completely seamless transitions.

    This may have unwanted side effects. e.g. visibility to an adjacent room that is not directly connected to the current room.

    [quote:3ts75lnl]Would there be a way to keep this, but just always have the character completely in the centre of focus? So the camera doesn't pan, just keeps focus on the player and is still on these "rails"?

    I don't think so. I can't think of a way to

    • Keep the camera on "rails"
    • Give the player a free range of motion
    • Perfectly transition the direction of rails (aka corners)

    Some kind of compromise needs to be made. However, if someone else on the forum can think up a better solution, I'd be happy to be wrong.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • What if we made an outline using sprites to form "rails"?

    Sorry that's a joke.

    What if we make the camera follow the player but unable to leave the "bounding boxes" i.e. zones?

    We make a sprite the size of the camera, invisible of course, and pin it's position to the player, then we make the camera follow the sprite instead of the player, and the sprite unable to leave zones but able to cross between them.

  • I don't thing that will work quite as you expect, but encourage you to play around with the capx to try and get the desired result.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
167 39,769
lucasgc1's avatar
lucasgc1
Unread hot topic
43 9,974
Lordshiva1948's avatar
Lordshiva1948
Unread hot topic
0 Favourites
Follow the Leader
41 5,886
franmcod's avatar
franmcod