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

Get help using Construct 2

Post » Sun Mar 12, 2017 5:37 pm

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)
Last edited by andersonaraujodl on Fri Apr 14, 2017 4:24 pm, edited 1 time in total.
B
11
S
3
G
3
Posts: 16
Reputation: 1,810

Post » Sun Mar 12, 2017 6:41 pm

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:

Code: Select all
<Event> On Player colliding with CameraWall_Vertical    |
               Else                                      |       FocalPoint.Y = Player.Y

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.
B
38
S
16
G
6
Posts: 537
Reputation: 7,582

Post » Sun Mar 12, 2017 10:22 pm

ErekT wrote: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:

Code: Select all
<Event> On Player colliding with CameraWall_Vertical    |
               Else                                      |       FocalPoint.Y = Player.Y

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! :-)
B
11
S
3
G
3
Posts: 16
Reputation: 1,810


Return to How do I....?

Who is online

Users browsing this forum: R0J0hound, RobertMKD and 5 guests