Function is not hitting if statement.

Get help using Construct 2

Post » Tue Jul 05, 2016 2:42 am

In my game, the enemy(birds or Roc) flying back and forth across the screen. I call a function called "CheckRoc" every tick to see if each enemy sees the player and if they do,then if they are free, they attack. At the start of the game, the enemy is obviously free and should attack on sight. However, they don't attack. It seems like it should be straightforward, and I've spent hours on this already. Here's the url if anyone wants to take a crack at it. https://www.dropbox.com/s/0e14dnd4wgb0efn/Uru.capx?dl=0
B
16
S
7
Posts: 46
Reputation: 1,344

Post » Tue Jul 05, 2016 4:29 am

You've got the Unicorn as a solid, so it is considered an obstacle.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Tue Jul 05, 2016 11:52 am

That was it! Now I have another issue. I have one enemy that I have dragged out of view so that I can instantiate them in the game. However, it attacks my player while outside the viewport, along with the enemies onscreen. How do I stop that? It wasn't doing it before, but I'm not sure what I changed to start it doing that? Thanks again.
B
16
S
7
Posts: 46
Reputation: 1,344

Post » Tue Jul 05, 2016 11:52 am

B
16
S
7
Posts: 46
Reputation: 1,344

Post » Tue Jul 05, 2016 12:22 pm

Add on start layout event, and destroy enemy
B
18
S
7
G
1
Posts: 157
Reputation: 1,928


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 43 guests