How do I make a camera blocking region

0 favourites
  • 3 posts
From the Asset Store
Simple and easily editable template for a dynamic camera that zooms in and out based on how far apart the players are.
  • Alright, this is kinda a catch, been trying to make a camera in construct 2 work by having an object type define areas the camera is not allowed the scroll into but the camera should also track the player so the camera will need to treat the blocking objects as if they are edges of the layout.

    Currently I have the camera set every tick to center on the player, so I can calculate the position before I commit it to the layout.

    Thanks in advance for any help.

  • I think the simplest way to do this might be to have the camera track an object the size of the screen. Have this object always pathing towards the player. When it overlaps areas that shouldn't be seen by the camera, steer it away from those objects. Good luck!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello, a quick update to the solution I did, while not a perfect solution if one is changing zoom, it might be of use to someone else to know the slightly odd means that I used, with a few tweaks you can even tweak it to find each edge.

    The camera region its self was a 1x1 image, with four image points representing its edges, it also contained information for how much to offset the camera by on the Y axis(one can also add the X axis to the same concept).

    Then each tick, from the players position(Not the invisible object representing the camera) I checked a point using a system statement exactly 128 pixels under the player(used 128 as it seemed to cause the least amount of camera snapping as I lerp the camera), if the statement picks more then one object in the particular group, it will use its top image point-Y offset to position the camera, otherwise use the players X and Y.

    If this confuses anyone I will see if I can clean it up, likely a bit rube Goldberg for most cases.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)