0 Favourites

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

  • 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.
  • Construct 3

    Buy Construct 3

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

    Buy 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)
Similar Topics Posts Views Last Post
Unread hot topic
99 10,139
karshinkoff's avatar
karshinkoff
Unread hot topic
118 32,902
rexrainbow's avatar
rexrainbow
Unread hot topic
88 9,241
goldentreee's avatar
goldentreee