[Solved] How do I set my Scroll to Y limit?

0 favourites
  • 3 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hello,

    I have a platform game in which I put the Scroll to Behavior in my main character. The thing is, I'm build a scenario with a underground path, but I want to limit my Scroll to Y to hide that, showing just the ground limit.

    Right now it puts my character in the center of the screen, showing half of the underground hidden path.

    Can someone help me with that? (Not sure if this is a duplicated topic, I couldn't find any help)

  • How about a separate, invisible object that follows the player around? Let's just call it FocalPoint. Put the Scroll to behaviour on that and restrict its Y movement when you're close to the underground path. You could do a simple coordinate check or you could have other invisible objects to fence off the FocalPoint object i.e. something like this:

    <Event> On Player colliding with CameraWall_Vertical    |
                   Else                                      |       FocalPoint.Y = Player.Y
    [/code:1x0072qq]
    When the player is overlapping one of these barriers the player moves freely but the FocalPoint, with the ScrollTo behaviour attached, doesn't. When the Player is no longer overlapping it, the FocalPoint starts following the Player again.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • How about a separate, invisible object that follows the player around? Let's just call it FocalPoint. Put the Scroll to behaviour on that and restrict its Y movement when you're close to the underground path. You could do a simple coordinate check or you could have other invisible objects to fence off the FocalPoint object i.e. something like this:

    > <Event> On Player colliding with CameraWall_Vertical    |
                   Else                                      |       FocalPoint.Y = Player.Y
    [/code:2duasae8]
    When the player is overlapping one of these barriers the player moves freely but the FocalPoint, with the ScrollTo behaviour attached, doesn't. When the Player is no longer overlapping it, the FocalPoint starts following the Player again.
    

    Thanks! I did something very similar and worked!

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