Spawn a Family object and then refer to it

Get help using Construct 2

Post » Fri May 18, 2012 12:51 pm

Hi there,

I've been trying to spawn a family object and then refer to it immediately after but it does not work. I have this:

Every 0.5 seconds -> Spawner.Spawn(Enemy)
                     Enemy.X=1800
where Enemy is a family containing two sprites Enemy1 and Enemy2.

Instead of applying the value to only the newly spawned object, it applies it to ALL objects that belong to the family Enemy. This seems inconsistent with how normal objects are dealt with (ie if we replace Enemy with Enemy1 which is a Sprite, it would behave as I want). How can I refer to the newly spawned object?

Thanks for your help!
B
19
S
5
G
4
Posts: 85
Reputation: 4,925

Post » Fri May 18, 2012 1:28 pm

Oops, it's a bug: creating a family doesn't pick the instance like it normally does. Fixed for next build!
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Post » Fri May 18, 2012 1:55 pm

Yay thanks Ashley! I'm looking forward to the fix! :D
B
19
S
5
G
4
Posts: 85
Reputation: 4,925


Return to How do I....?

Who is online

Users browsing this forum: Magistross, Yahoo [Bot], zatyka and 24 guests