Camera follow the player only when walk to the right

Get help using Construct 2

Post » Tue Aug 12, 2014 11:05 am

Hello,
i would like to know how can i setup the camera,following the character,to only move forward(to the right in a 2d platformer).
So the camera wont follow the player when walking to the right.

Thanks,
Costa
B
23
S
5
G
1
Posts: 40
Reputation: 1,281

Post » Tue Aug 12, 2014 11:13 am

Easy way would be something like this:

Create global variable CameraOldX

System every tick
System compare two values: Sprite.x>CameraOldx
- system scrollto x=sprite.x, y=sprite.y
-System set value CameraOldX: sprite.x
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Aug 12, 2014 11:47 am

Thanks,that worked perfectly
B
23
S
5
G
1
Posts: 40
Reputation: 1,281

Post » Tue Aug 12, 2014 2:19 pm

Or just PlayerX > scrollX then set scroll X to PlayerX
B
34
S
9
G
3
Posts: 517
Reputation: 5,226


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], ultrafop and 7 guests