How do I follow object movement with camera?

Get help using Construct 2

Post » Sun Sep 13, 2015 3:31 am

Hi, i want to create a platform game like geometry dash, where the camera follows the moving object.
Example: A box moving to right, and camera moving to right also.

I create a game where that works, because i create a box with platform behavior and the event System Every Tick, Simulate platform pressing right.

Now i create other game that have many objects, like boxs, score sprites, live sprites, functions, and when i create the same function for the box simulate to pressing right, the box moves to right but the camera remains static.

Whats parameter i should to change for make the camera follows the object in movement??

Something layers?, layout?, or behaviors?
Thanks
B
4
Posts: 50
Reputation: 290

Post » Sun Sep 13, 2015 3:51 am

First of all dont simulate movement. The arrow keys are already bonded so you don't need to set this up.

Go to your player sprite and add a behavior. I think it is called Scroll-To or something similar.
B
56
S
15
G
13
Posts: 825
Reputation: 17,643

Post » Sun Sep 13, 2015 4:26 am

But i will not to use the arrow, i wil to use the touch, only for jump. The scroll to seems that not move the screen :S
B
4
Posts: 50
Reputation: 290

Post » Sun Sep 13, 2015 9:02 am

even if you simulate the controls or not.. it wont matter... add the behavior scroll to on the player sprite and will automatically adjust the camera position to keep the player in the center of the screen or at a 100 px away from the left or right border... it wont work unless you have the layout size bigger then the game size ... you can see the game size in the left side after you pressed the name of the project in the project right side bar... youl have a width height property its automatically 800x600 if you go to layout by default its bigger... make the layout bigger then 800x600 and the behavior will work hope it helped you :)
B
70
S
20
G
67
Posts: 1,314
Reputation: 42,301


Return to How do I....?

Who is online

Users browsing this forum: alextro, tarek2, wenwen11212016 and 7 guests