Add an object to many containers?

0 favourites
  • 3 posts
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • Hi, I'm new with C3 and C2. I'm making a space shooting game and get a problem. When destroying enemies, they drop power-up items. These items have many types with different sprites (I've already put them in a family) but have the same effect (2 glowing dots rotating around, which is also a sprite) behind. I'd like to use container to group the effect sprite to each one of item sprite, but it's impossible. The effect sprite can be in only one container. Are there any way to deal with this? Manually creating and destroying the effect sprite is somehow inconvenient.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • You can't add an object to multiple containers. But you can create a simple event that will attach the effect sprite to each item:

    On ItemsFamily created -> ItemsFamily spawn EffectSprite
                              EffectSprite pin to ItemsFamily[/code:2vkq1xm7]
    
    And another event to destroy it:
    [code:2vkq1xm7]On ItemsFamily destroyed 
       System -> Pick EffectSprite by comparison EffectSprite.Pin.PinnedUID=ItemsFamily.UID   -> EffectSprite destroy
    [/code:2vkq1xm7]
  • Thank you, sir! It's worked!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)