Objects following player.

Get help using Construct 2

Post » Tue Mar 13, 2012 9:50 pm

So I'm trying to get some objects to follow the player around.
The easiest way I've found so far is to make the objects platformer behaviour (which has a lot of drawbacks). I've got one object working but when I copy paste it they will not run as seperate objects but rather as two twin objects (one stops moving the other does as well).

http://dl.dropbox.com/u/65431535/chasing.capx

I want them to act seperately from each other. :/
B
4
Posts: 46
Reputation: 617

Post » Tue Mar 13, 2012 11:21 pm

Thinking there are loads of fun ways to do this. Here is the first one that came to mind,using platform behavior on the kittens , like your original
Event comments explain it a bit. and the kittens now have a variable that allows you to give each kitten it's own distance if you need it.
chasing_idea.capx dropbox downloadonzephyr2012-03-13 23:38:36
B
85
S
14
G
9
Posts: 100
Reputation: 9,885

Post » Wed Mar 14, 2012 12:03 am

Thank you zeph. Much appreciated.
It's something I started toying with on my way home from work.

I will see if I can get something interesting going as a proof of concept. As you can tell from my tiles my artist side of me isn't very strong. :)
B
4
Posts: 46
Reputation: 617

Post » Fri Mar 16, 2012 5:52 pm

Hi All,

Loving construct2 and I've been playing around with it for a week or 2 but now I think it's time to produce something. So I'm also making a project with this kind of follow behaviour and i've created my capx by recreating the above, but for some reason instead of the kitten or "lilbro" in my case staying a distance away from the cat (bigbro for mine) it just travels to the centre of the sprite then wobbles. I've got a feeling that this is one of those things where you stare at something for so long and not see it and then someone else will see it straight away. I would appreciate another set of eyes before I go crazy.

http://dl.dropbox.com/u/8341647/hometime.capx
B
3
Posts: 4
Reputation: 283

Post » Fri Mar 16, 2012 7:35 pm

@shifty:
You need to put the last two events as sub-events of the first. You can do this by dragging them to the bottom of the first event in the event sheet. The manual also covers sub-events.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Fri Mar 16, 2012 8:10 pm

Aha! Thank you Nimtrix it works!!
B
3
Posts: 4
Reputation: 283

Post » Thu Aug 09, 2012 11:55 pm

What if there is a hole? How can you make it follow the player without adding additional objects to the game?
B
85
S
31
G
22
Posts: 384
Reputation: 18,592

Post » Fri Aug 10, 2012 2:10 am

@jogosgratispro probably just add another event that says if the players Y is less than the object thats following the players Y, then simulate jump for the object following.
B
13
S
3
G
1
Posts: 44
Reputation: 1,152

Post » Fri Aug 10, 2012 2:19 am

@Kid4lynn It makes sense but it wouldn't work because the follower would fall into the hole since it is jumping before it gets to the hole.
I think the best idea is to place some invisible objects, so the follower would simulate jump when hit it.
B
85
S
31
G
22
Posts: 384
Reputation: 18,592

Post » Fri Aug 10, 2012 3:02 am

@jogosgratispro why would he jump before it gets to the hole?
B
13
S
3
G
1
Posts: 44
Reputation: 1,152

Next

Return to How do I....?

Who is online

Users browsing this forum: chcteacher, Televangelist and 25 guests