Moving toward player

Get help using Construct 2

Post » Fri Mar 24, 2017 12:17 am

I have random ojects moving toward player but if my player dies the spawners would head to upper left at 0,0 position. How come and how do I eliminate this problem.

Thank You.
B
24
S
4
Posts: 78
Reputation: 1,308

Post » Fri Mar 24, 2017 1:27 am

When your objects spawn is based on an object that is no longer there then it returns a null or zero value and that is why they head to 0,0.

You can fix it by making your player invisible and disabled instead of destroying it when dead or when dead set the spawned objects to the last position the player was at or some other position.

You would need to store the players last position X and Y in global variables if you want the objects to continue moving to that position.
Banned User
B
28
S
7
G
58
Posts: 1,229
Reputation: 34,830

Post » Fri Mar 24, 2017 2:19 am

Hi lamar,

I think I can follow along with your suggestion.

Thank You.
B
24
S
4
Posts: 78
Reputation: 1,308


Return to How do I....?

Who is online

Users browsing this forum: irina and 6 guests