editing the "scroll to" behavior

0 favourites
  • 11 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hello, I was wondering if anybody could help me solve an issue I have with the "scroll to" behavior. The issue is this: I have an invisible box that has the scroll to behavior added to it. My sprite has his position set to the invisible box. Everything works fine as is. The main issue is that the invisible box is centered so that it's hard to see anything above my sprite. I have only found one topic on this issue but I don't know how to apply it to my problem. https://www.construct.net If I position the invisible box near the bottom of the layout, everything is fine. But when I start going up on any surface, the box is too high, and it makes it hard to see anything above. I am still relatively new to Construct 3. Any help would be greatly apricated.

  • I'm not sure what you've done here but usually the scroll to is on or around the player object

  • It's hard to know what's really not working for you.

    Here's a little example with this behavior. Maybe it will help you in some way.

    dropmefiles.net/en/45Av

  • Thank you for the fast reply! My game is a platformer so the link you sent me doesn't apply to my problem. My sprite is quite big in comparison to my viewport which is the size of a Gameboy Advance viewport. I'm having trouble figuring out how to post an image of my problem, so I'll try my best to give the facts: System on every tick, set Tony's position (the sprite) to "Tony's Box".(the invisible box with the scroll to behavior.) My viewport is 240 by 160, and my sprite is 35 pixels wide and 65 pixels tall. I don't know if it's possible to position him more towards the bottom of the screen so you can see more above the player.

  • I changed the example with the camera.

    But it is very sad that you saw that this is not a platformer. But you missed the point.

    Only beginners hang the camera rigidly on the character or his invisible sprite.

    In a platformer it is very important to have clear controls and the camera becomes very sharp.

    It is much softer to create an invisible sprite of any size and move it through "Lerp".

    Please notice the elephant in the room if he is there!))

    dropmefiles.net/en/NPTsR5xG97

  • Okay so I tried the code, but now Tony's Box moves a little on a key pressed, but my sprite stays where he is and the camera kind of just jerks. The Tony's box has the platform behavior added to it, so I added a second invisible sprite that had the scroll to behavior added to it instead, then set it's position to Tony's Box with the lerp, but it's still not working! The sprites are just floating in the air and I can't control anything! Here's all of the code:

    Every tick: Tony: set position to Tony's Box. Then in another event, Every tick: Camera: set position to Tony's Box with the Lerp.

    The camera is the only object with the scroll to behavior. What am I doing wrong? Thank you so much for the trouble!

  • Okay wait my bad!! One of the codes I wrote was messed up! It should have been TONY set position to Tony's Box! So the codes you sent work great, and the camera movement is very smooth, But Tony's box is jittering and so is the sprite. otherwise everything works!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's hard to understand without code.

    Need c3p file.

  • Hello! I don't know how to upload a C3p file but I just fixed the issue with unchecking the pixel rounding.

  • That's great!

    It's always better to find the problem yourself, it upgrades us!

  • Thank you again for your time! :D

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