Make an object follow the player without rotating?

Get help using Construct 2

Post » Thu Aug 30, 2012 5:26 am

I'd like it to stay flat without any rotation while it follows the player around, ala a tile based game only I'm not doing tile based movement. Does this make sense? I hope so.

Any help would be much appreciated. Thank you!

- Tom
B
2
Posts: 2
Reputation: 254

Post » Thu Aug 30, 2012 5:39 am

Will the follower be moving at the exact same pace as the followed?
Will there be a delay, or a certain distance between them before he starts following?
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Thu Aug 30, 2012 5:51 am

Nope, I plan to have the follower be a bit slower and I'd like him only to follow if he's visible to the actual player looking at the screen.
B
2
Posts: 2
Reputation: 254

Post » Thu Aug 30, 2012 10:17 am

Check of the object is in the screen.
Give him custom movement.

Check if Follower.X > Followed.X,
If it is, set its horizontal speed to eg. 3
Else, set its horizontal speed to eg. -3

Check if Follower.Y > Followed.Y,
If it is, set its vertical speed to eg. 3
Else, set its vertical speed to eg. -3

To make him stop when near the followed.
Check if distance(follower.Y,0,followed.Y,0) is NOT < eg. 50 when doing the above events.
B
36
S
10
G
6
Posts: 948
Reputation: 11,101


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, MChiz, Radulepy and 0 guests