Two way linking of objects?

Get help using Construct 2

Post » Sun Sep 29, 2013 6:11 pm

So I have an arrow that spawns and points in the direction of another sprite, linked to angle towards it based on UID/IID.

The only problem I'm having though, is not spawning duplicate arrows.

Is there an easy way to check if a sprite with a particular instance variable exists already before spawning?

Image
B
27
S
9
G
5
Posts: 495
Reputation: 11,964

Post » Sun Sep 29, 2013 7:45 pm

I'd just use the uid instead of iid and uid. Here's a way to rework event 190 to stop creation of duplicates. The else is run only when there are no arrows paired with a pickup.

+circleBounds: on collision with BoxPickups
+For each BoxPickups
---+ArrGd: ThnUd = BoxPickups.uid
------ //nothing
---+Else
------- //your creation actions
B
100
S
38
G
134
Posts: 5,553
Reputation: 85,319


Return to How do I....?

Who is online

Users browsing this forum: Ofris, socialpilgrim and 4 guests