Create new objects pinned to their counterparts

Get help using Construct 2

Post » Tue Mar 04, 2014 9:27 pm

Hi there,

I was wondering if there is an effective way to be able to spawn objects and have them pair up.. here is an example of what i mean..

imagine you have to create 10 (or 100) tanks.. each tank has a turret.. and maybe text fiend that identifies each one uniquely..

I just can't quite figure out how i would be able to do a parent / child dynamic pairing when i create objects.. using the pin behavior is fine if you can clearly mark the objects you want to stick together.. but i'm not sure how i would us pin or any other method to make a body, turret and text fiend to group together at the time of creating these new objects from thin air.

Thanks!
Caleb
B
59
S
9
G
1
Posts: 939
Reputation: 6,545

Post » Tue Mar 04, 2014 10:26 pm

Have a look at how containers work.

Think that can do the trick for you.
When you create one object the other objects in same container are created and if 1 is destroyed so are all the members of the container.

https://www.scirra.com/manual/150/containers
B
20
S
6
G
4
Posts: 347
Reputation: 4,451

Post » Wed Mar 05, 2014 2:21 pm

Ok I'll check into those again.. i did check them out before but stuff wasn't working.. so i moved on to other things. I'll report back what I learn!

Thanks!
Caleb
B
59
S
9
G
1
Posts: 939
Reputation: 6,545


Return to How do I....?

Who is online

Users browsing this forum: fearfulelephants and 18 guests