How do I make an onject run from player?

Get help using Construct 2

Post » Sun Mar 22, 2015 11:19 am

i am making a rpg game,but how do i make the animals in the wild run from the player when they see him?
B
15
S
4
Posts: 153
Reputation: 1,385

Post » Sun Mar 22, 2015 11:41 am

Hi,

You can use "line of sight" behavior on animals to detect when the player is close to them
B
14
S
4
G
2
Posts: 190
Reputation: 3,938

Post » Sun Mar 22, 2015 12:09 pm

There are several ways that will let you execute that

1 as the person above me said use the line of sight behaviour
2 use the overlapping offset event
3 (the most simplest one) have a gigantic invisible circle around the player and have the game detect animals in the circle and move them out
B
5
S
1
Posts: 60
Reputation: 495

Post » Sun Mar 22, 2015 3:50 pm

Ash,in solution number 3,what do you mean by "detect animals in the circle and move them out"?

Guys I already made the animals able to detect the player,but the problem is how to make the animals run away from the player or make the animals run in the opposite direction of the player.

So......can you help me?
B
15
S
4
Posts: 153
Reputation: 1,385

Post » Sun Jun 14, 2015 5:37 am

Well now this is a real late reply, sorry for the delay did not see your reply hope this is still of use to you

mediafirecom/download/3k6cxx5o6dnpy36/animal+Run+eg.caproj

add the www. and .com
B
5
S
1
Posts: 60
Reputation: 495

Post » Fri Jun 19, 2015 4:35 pm

I already deleted the project, but thanks anyway
B
15
S
4
Posts: 153
Reputation: 1,385

Post » Fri Jun 19, 2015 10:09 pm

This would be a perfect fit for this kind of behavior:

behavior-rex-ljpotential-attracting-or-rejecting-objects_t112786

To choose whether to activate/deactivate, use line of sight on your player char, and look to see when player can see animals. Much cheaper than putting LOS on every single animal. ;)
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202


Return to How do I....?

Who is online

Users browsing this forum: jojomickymack and 33 guests