How do I make the camera to follow nearest?

Get help using Construct 2

Post » Mon Jun 08, 2015 8:05 pm

I'm making a running game and want the camera to follow the person in the lead. I've got two players and they only run on the X-axis.
-K
B
7
S
1
Posts: 37
Reputation: 513

Post » Mon Jun 08, 2015 8:20 pm

Instead of following the nearest, Just compare the x of both character every tick, and set the position of the camera to whatever character has the biggest X value
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Mon Jun 08, 2015 8:21 pm

Unless they're running from the right to the left, on which case the camera should follow the one with the least X value
B
17
S
7
Posts: 277
Reputation: 2,514

Post » Mon Jun 08, 2015 8:24 pm

This might help you.
WASD- Left guy
Arrow Keys- Right guy

https://mega.co.nz/#!7xV3UBID!WUV7rUU6y ... IeEaKosWFA - File hosting
B
8
S
2
Posts: 39
Reputation: 604

Post » Mon Jun 08, 2015 8:52 pm

I do have WASD and Arrow keys set, but thanks for your help, both.
-K
B
7
S
1
Posts: 37
Reputation: 513

Post » Mon Jun 08, 2015 10:11 pm

It's no problem, also I was just telling you the controls for the .capx i sent you. Glad I could help :)
B
8
S
2
Posts: 39
Reputation: 604


Return to How do I....?

Who is online

Users browsing this forum: MaujDeveloper, mrkaio, user5487, Zav and 2 guests