container - 2nd sprite not automatically created

This forum is currently in read-only mode.
From the Asset Store
Awardkit
$5 USD
Create custom awards and achievement or use the many templates and create your own.
  • As I understand from the Wiki, If 1 sprite is created, the 2nd sprite will automatically be created too, when the 2 objects are in a container.

    This doesn't work in my new test cap, though.

    I created sprite1 and sprite2. (red and blue simple square) I placed them so that they overlap eachother.

    Clicked on sprite1, add container --> clicked on sprite 2.

    Now when I click on sprite 1, sprite 2 gets a yellow outline, suggesting it is in the same container.

    But when I create sprite1 every 1000 ms, there is no sprite 2 to be seen in runtime.

    (using: C0.99.96)

  • Did you set xy of the 2nd sprite?

  • So that is what I missed.

    I added:

    always>sprite2 x = sprite1.x, sprite2 y = sprite1.y

    And I get the result I wanted and expected, from using containers.

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Speaking of containers i have similar problem, but in my case there are 3 objects in container.

    Every one have different sets of behavior (1- physics, 2 rts, 3...) so altogether they make something like "enemy chasing player system" and i havent figure it out how to spawn them via "System -> create object".

    Basicaly there's "main sprite" witch always have position set to "sprite detector" (with physix).

    "Sprite detector" always follows "sprite follower" (with rts).

    "Sprite follower" always moving to player position.

    If i spawn "main sprite" usually nothing happening - just sits in his spawn position.

    When i spawn "sprite follower" it start chasing player, but no more sprites have been spawned - same with "sprite detector" - just bouncing around if player hit it.

    But when i spawn all three of them... well i can't describe that whats happening on the screen

  • The thing to remember is that if you create one you create all, and all are placed into the selected object list, check the debugger it will show it exists even if you don't see it. Then not all behaviors play well together.

    Also not all behaviors work well with Always. Sorry I can't be more specific, but rts and physics are kind of like oil and water.

  • Why you use old version of Construct? oO Use new, than you don't got similar problems.

  • my container works fine if i manualy copy as many instances as i want - i just copy ie 10 "sprite detctors" to random places on my map, and is all good. It makes me 10 enemies behaving correctly in runtime.

    It's only not doing that by "System -> create object" - and debug whows indeed that only one object from container was created :/

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