Clever movement

Get help using Construct 2

Post » Thu Jul 31, 2014 12:35 pm

i want to enemy move towards player when distance ( distance variable is 120 or less) for 5 seconds. Then enemy walks to random directions.

i have made these already to AI:
-distance variable
-distance variable calculation event
-random enemy movement "when variable noticed is false"

how you do recommend me to do? :?:
Posts: 68
Reputation: 1,459

Post » Thu Jul 31, 2014 2:16 pm

You can use LineOfSight behavior to detect the "120" distance and activate the enemy movement. Combine this with moveTo behavior provided by rexrainbow and you'll get what you want.

Here the capx of one of my examples:
PS: The red circle is the enemy's line of sight, if you enter on that area the enemy will automatically "follow you".
PS2: maybe you'll need to disable touch movement and enable keyboard movement on "playerInput" EventSheet.

moveTo Behavior:
Posts: 20
Reputation: 302

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests