How to trigger angle of motion just once?

Get help using Construct 2

Post » Tue Dec 03, 2013 12:12 pm

Hi everyone,

I want the enemies to spawn out of the screen and if they spawn to the right of the player they go to the left, and if they spawn on the left of the player, they go to the right. I don't wish they to change their direction.

To do this I made these behaviors:



As you guessed, it didn't turn very well and the enemies don't stop following the player.

Do you know how to fix this?

Thanks!
B
7
S
2
G
1
Posts: 13
Reputation: 1,101

Post » Tue Dec 03, 2013 12:36 pm

change the is on screen to on created, then you can remove the trigger once and the stop loop for they are not needed.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Dec 03, 2013 1:05 pm

Many thanks @LittleStain!

It worked like a charm!
B
7
S
2
G
1
Posts: 13
Reputation: 1,101

Post » Tue Dec 03, 2013 8:06 pm

Another trick is adding a "Trigger once while true" condition.
Thiago Rocha
[email protected]
B
17
S
4
G
5
Posts: 41
Reputation: 4,269

Post » Thu Dec 05, 2013 4:22 pm

Many thanks @Thiago! That will help a lot too!
B
7
S
2
G
1
Posts: 13
Reputation: 1,101


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests