Invert Line Of Sight Condition

Just started using Construct 2? Post your questions here

Post » Sun Dec 21, 2014 5:23 pm

The Sprite is destroyed even it has line of sight of sprite2
You do not have the required permissions to view the files attached to this post.
B
17
S
4
G
1
Posts: 203
Reputation: 1,583

Post » Sun Dec 21, 2014 5:51 pm

Use else instead.
Image ImageImage
B
172
S
50
G
183
Posts: 8,443
Reputation: 115,605

Post » Mon Dec 22, 2014 1:32 pm

Are you SURE it has line of sight all the time? Note that, according to this condition, if it loses the LoS for no matter for how long, it WILL be destroyed.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
21
S
6
G
3
Posts: 664
Reputation: 3,855

Post » Mon Dec 22, 2014 5:35 pm

I put one sprite2 beside it from the start of the layout and another one outside range
B
17
S
4
G
1
Posts: 203
Reputation: 1,583

Post » Tue Dec 23, 2014 2:05 pm

Without a capx is hard to say what's wrong. But, even if it's beside it, maybe it's out of LoS. Depends on the angle you set for the LoS behavior and the orientation of the object with the behavior itself.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
21
S
6
G
3
Posts: 664
Reputation: 3,855

Post » Tue Dec 23, 2014 4:08 pm

its quite simple,just create 2 sprite2 one is in sight of Sprite and another doesnt
B
17
S
4
G
1
Posts: 203
Reputation: 1,583

Post » Tue Dec 23, 2014 5:54 pm

So. You're checking for absence of LoS. One of them is out of LoS, so the condition is true, and the sprite gets destroyed. I guess one of them being out of LoS is enough to trigger the condition.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
21
S
6
G
3
Posts: 664
Reputation: 3,855

Post » Tue Dec 23, 2014 6:31 pm

Yes,but this will make invert useless here
B
17
S
4
G
1
Posts: 203
Reputation: 1,583

Post » Tue Dec 23, 2014 6:50 pm

Sadly yes... :) I'll try to find a workaround and I'll let you know if I do.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
21
S
6
G
3
Posts: 664
Reputation: 3,855

Post » Tue Dec 23, 2014 7:09 pm

I'm not sure this is what you're looking for.... But check it and let me know.

inverted-los-example.capx


Move the red circle with the arrows. If it loses LoS (100 distance) for both blue circles it's destroyed. You can regenerate it by hitting SPACE.
You do not have the required permissions to view the files attached to this post.
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
21
S
6
G
3
Posts: 664
Reputation: 3,855

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 5 guests