How do I distance problerms.

Get help using Construct 2

Post » Wed Mar 22, 2017 12:50 am

Hi guys. a new problem. i made a complete enemie. they shoot they hunt they kill but. a problem is i made a detection with Distance(player.x,player.y.Sniperx.sniper.y) so... problem is ... when they enemie is on a platfrom top of me. On a bridge for example. it continue shooting. how can i fix it. (i mean i am under bridge, enemie top of bridge. it cant kill me or shoot me but continue shooting forward on side were i am)
B
13
S
4
G
2
Posts: 34
Reputation: 1,945

Post » Wed Mar 22, 2017 1:35 am

You need to add Line of Sight behavior, so the enemy will only shoot when they see the player.
ImageImage
B
109
S
49
G
23
Posts: 783
Reputation: 22,636

Post » Wed Mar 22, 2017 4:03 am

alextro wrote:You need to add Line of Sight behavior, so the enemy will only shoot when they see the player.

can you explain me better about it? sounds much better then distance and compare two values. i am new
B
13
S
4
G
2
Posts: 34
Reputation: 1,945

Post » Wed Mar 22, 2017 4:17 am

give the sniper the line of sight behavior, it should make sense once you look at the behavior.
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » Wed Mar 22, 2017 9:10 am

If you applied Line Of Sight behavior, there will be extra option to add other object as an obstacle and option to set the range. After you do so, in other event you set the condition "Has LOS to object" to detect if player visible to enemy or not.
ImageImage
B
109
S
49
G
23
Posts: 783
Reputation: 22,636

Post » Wed Mar 22, 2017 10:40 pm

Thank you werry much guys
B
13
S
4
G
2
Posts: 34
Reputation: 1,945


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 17 guests