How do I make ennemies walking to the player actual position

Just started using Construct 2? Post your questions here

Post » Thu Mar 02, 2017 9:30 am


After i followed the beginner's guide "Ghost Shooter" i saw the event "when monster is outside layout > set angle toward (playerX, playerY)".
This event make the monster set his direction toward the player position at the moment he get outside the layout, not on the actual player position. And i wanted to know how to make an enemy focus the player origin point at any moment of the game.

I checked for patroll tutorial, but its about plateform game, so only left and right, and this game is in top view.

Can someone help me or redirect me on a link? Thanks alot guys ! =)

(Sorry, there is probably some mistakes in my english, im french)
Posts: 2
Reputation: 204

Post » Thu Mar 02, 2017 6:44 pm

Basically, you have to refresh the Monster's target coordinates regularly.
Do this by using the following conditions/actions:
Code: Select all
Every X seconds
    -> For each Monster
         -> Set angle toward Player.X, Player.Y
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
Posts: 528
Reputation: 7,091

Post » Thu Mar 02, 2017 7:29 pm

Look so obvious now haha. Didn't even thought about time ...

Thanks ALOT mate !! =) You just gave me a huge help for my project !
Posts: 2
Reputation: 204

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 4 guests