How do I manipulate the ScrollTo function

Get help using Construct 2

Post » Tue Aug 16, 2016 6:07 pm

HI,

Two questions. First, how can I stop the ScrollTo function from running. On the bottom level of a multi-leveled platform stage, I want to have the Player jump into a hole and have the ScrollTo not follow him. I think it has to do with Y and LayoutHeight, but I can't figure out which way Y runs... is it at Zero on the bottom of the layout and increasing positively upwards, or negatively? I've tried Y greater than LayoutHeight + 50 but not getting anywhere....

Second, how do I adjust the ScrollTo function so that it does not center the Player. I'd like to show more area above the player's head permanently as they navigate through the levels. I figure this is also maybe a System adjustment.

Any suggestion appreciated,

thanks
M
B
7
S
1
Posts: 23
Reputation: 421

Post » Tue Aug 16, 2016 6:58 pm

1. You disable it with the action ScrollTo > Set Disabled when the player falls down the hole.
2. The manual states that you can't directly adjust it. You can however create an invisible object that you ScrollTo, which I guess would act like an invisible camera. For example, if you Pin an invisible object to the player, offset from the player as much as you want the player to be off-centre, then you assign ScrollTo to that object, the invisible object will move with the player but the ScrollTo will be focused on the invisible object. Alternatively, you could also allow the invisible object to move freely if you want it to change throughout the game, if you want the player to become centred again then disable it on the invisible object, enable it on the player etc etc
B
45
S
15
G
73
Posts: 2,007
Reputation: 43,396

Post » Sat Aug 20, 2016 1:53 pm

Thanks plinkie,

I added the invisible object and pinned it to Player, put the invisible object a little bit above my player and then added the scrollTo function to the invisible object, works like a charm. (disable collisions, kept visible, turned opacity to zero on the invisible object).

And when they jump in the hole I made an invisible object for the player to collide with that turns off the scrollTo function on the phantom player.

cheers,
M
B
7
S
1
Posts: 23
Reputation: 421


Return to How do I....?

Who is online

Users browsing this forum: Manubis, Ryan Kocourek, TheSupreme, TylerJS and 10 guests