Page 1 of 1

Enemy Looking Around when LOS is Broken

PostPosted: Sat Nov 30, 2013 11:07 pm
by 80bit
Hey there.. was curious if anyone has run into the challenge of making an enemy (esp. when multiple of the same type) will look around randomly whenever you are out of their line of sight. I feel like I'm doing everything i need to be doing with the actions, but its not working at all.. This is what I have:



Obviously its wrong because it's not working, but I cant think of any other way to do it?

Any help would be massively amazing, i appreciate your time. :D

Re: Enemy Looking Around when LOS is Broken

PostPosted: Sun Dec 01, 2013 12:29 am
by JohnnySix
I'd put the random seconds at the top, or instead, have a variable/counter for each enemy and have that count down.

Once it hits zero, trigger the event and set a new counter amount.

I did a web demo - they turn green if they can see you, red if not.

Mouse over to see counter and direction boolean.

http://johnnysix.net/games/LineOfSight/

CAPX :

http://johnnysix.net/games/LineOfSight.capx

Image with events :

JohnnySix2013-12-01 00:29:53

Re: Enemy Looking Around when LOS is Broken

PostPosted: Sun Dec 01, 2013 1:47 am
by 80bit
This helped me so much, Johnnysix, thank you so much!!