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
3
G
2
Posts: 34
Reputation: 1,795

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
102
S
45
G
22
Posts: 772
Reputation: 21,493

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
3
G
2
Posts: 34
Reputation: 1,795

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
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

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
102
S
45
G
22
Posts: 772
Reputation: 21,493

Post » Wed Mar 22, 2017 10:40 pm

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


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], imothep85, newt and 10 guests