How to constrain camera scrolling

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I've asked this before but had little luck with it thus far. I need some tips on how to lock camera scrolling to specific zones on a larger sized frame. For example, my stage frame would be 6421 x 2408 and my screen resolution is at 320x240. My thinking is, the correct way to start would be put the lowest point of the stage at the bottom of the frame, and work my way up. The problem is, i have doors that transition from zone to zone and i want the camera to lock to specific zones until opening a door, then when the player walks in, the camera needs to slowly move forward to a point until the character walks in and then lock to that new position. Basically, look at Castlevania as a better reference lol.

    Developer/Composer :

    Vamprotector

    Castlevania Chronicles 2 - Simon's Quest

    Castlevania Chronicles 3 - Dracula's Curse

  • Thanks for the file dude :) I just had a thought; would i not be able to accomplish the same thing using something like a counter? For instance, say like in the video it only shows the ground level and that's it, make that zero, then when the player reaches the door, change that counter to 1 and move the camera to the center position of that zone? And then do the same for other areas? May sound crazy but i'm going to try it lol. Thanks again casleziro!

    EDIT: That worked! By adding a counter for the zones, i'm able to lock the constraints on the camera's X/Y position (at least to scroll like in the vid lol).

    Developer/Composer :

    Vamprotector

    Castlevania Chronicles 2 - Simon's Quest

    Castlevania Chronicles 3 - Dracula's Curse

    Edited once, last by Warmachine (October 24, 2016 at 3:06 AM).

  • Casleziro's example is great, works very smooth.
    I made a tutorial for that type of scrolling, you get with similar results,
    I'm just doing it a little different.
    Please login to see this link.
    :D

    Please login to see this link.Please login to see this link.
    Take a course in Clickteam Fusion Please login to see this link.
    Youtube Please login to see this link.
    Please login to see this link.

  • I've seen your example Sparckman, very good also! But i'm looking for something like what's seen in the earlier Castlevania games and so far have achieved it using a counter and camera positions when the counter is at different numbers. The player's position is what switches the counter number and the x or y of the camera moves to that location smoothly :)

    Developer/Composer :

    Vamprotector

    Castlevania Chronicles 2 - Simon's Quest

    Castlevania Chronicles 3 - Dracula's Curse

  • I happened upon this example a couple days ago, and have been loving it so far! It does practically everything I could have hoped it would do. However, there are a couple things I've been trying to make it do that I have not quite been able to figure out:

    1. I managed to figure out how to adjust the speed of the scroll when the camera object detects the edge of the 'zone', but I have not been able to figure out how to get rid of the "shaking" that occurs when the player moves around. The only solution I found for it was to crank the value of "spd" up to 1000, which gets rid of the shaking when the player moves around, but then the "sliding" effect is lost because the speed is too instantaneous. Reducing the value of 'spd' leads to the camera lagging behind and needing to 'catch up' when player movement stops.

    2. I thought that if I changed it so that the camera object follows the x and y position of the player, and if the camera object overlaps one of the zones (for context, I converted the zones into 'outlined boxes with nothing in the middle), and tried to instruct clickteam to ignore player control when the camera object collides with any of the zones, then to restore player control when it isn't. But then it ends up stopping the full transition midway through, and you're left with the camera object getting hung up, and then (because the camera object is still overlapping the zone(s), the player can no longer move at all.

    I thought that if I added sensors, and gave them animations, I could fool the camera object into behaving how I want. I also tried using "mod 1", to see if I couldn't "zero out" the transition so the player could not move so long as the xpos contained any decimals, and even tried some basic math to get my result (which led to the calculator giving me a huge non zero to the "+e power"--round helped me solve that issue though), but all the results ended up the same.

    It is certainly a learning experience, but I'm starting to scratch my head a bit on this one.

  • I would make an alterable value for the minimum value of the camera that updates when you enter the door. Then disallow the camera from being X amount of pixels to left from the minimum to force it to go to the middle like in the Castlevania example you provided. So make the camera follow the character yes, but only if it's position is larger than Minimum value + X, if it is less. force it right. The example assumes you are going from left to right through the door.

    *EDIT*

    I guess you don't need +X. I just thought it would be handy so you could input a "screen move amount value here", and always pull the minimum value from the door position or something.

  • Check this out:

    Linky
    January 26, 2024 at 10:29 PM

    Game/App developer, artist and a community contributor.
    You can support my work on: Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!