How do I adjust layout size based on character positions.

0 favourites
  • 3 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • I'm working on a brawl/smash sort of game and I have a camera with the scroll to function with a lerp.

    When a character is almost at the edge of the view I want the camera to zoom out (Layout size) but the only way I can find is to set the layout size, not to adjust it per second or tick. Does anyone have any ideas how to do this?

  • You can change the layout scale over time.

    Every tick->Set layoutscale to lerp(layoutscale, target, 5*DT)

    Target is the layout scale you're shooting for.

    Alternately, you could also add or subtract to it over time until a certain condition is meet.

    If layoutscale >0.5 ---> set layoutscale to layoutscale-0.2*DT

    Meaning it will subtract 0.2 gradually per second until it reaches about 0.5.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh god, so dumb of me that I let a simple lerp slip my mind (since I used it for the camera too).

    Thanks I'll post back if it has the effect I need, or not, or better I'll just edit this post if there are no more new posts.

    Edit: It worked, First I calculated the distance between the characters and stored it into a variable and used that variable to zoom out based on the distance between those objects (players) using the lerp. Thanks, this problem is solved rather quickly.

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