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: 488
Reputation: 11,948

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
92
S
32
G
110
Posts: 5,295
Reputation: 71,501


Return to How do I....?

Who is online

Users browsing this forum: 25games, jatin1726, kiki4construct, Username05 and 32 guests