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
91
S
31
G
103
Posts: 5,235
Reputation: 67,756


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Bro7hers, jatin1726, ketramtu18 and 9 guests