How do I pin to family on start of layout?

0 favourites
  • 5 posts
From the Asset Store
A collection of various zombie characters sprites for creating a 2D platformer or sidescroller game
  • Hey there,

    I have a problem. This time, I’m trying to make a chain on start of layout.

    I’m using pin behaviour -template (which is included in C2) as a base. In this example, Blobs are already on layout and are pinned to each other on start of layout. Then, depending of their instance variable “number”, they are pinned to player or to each other. (I won’t cover that much details here, check my capx or example in C2 for more details)

    However, I need to create these blobs during run time on start of layout. This is where I’m having a problem. First I thought I can just replace “for each” with “repeat nn times” event and call it a day. I was wrong. I don’t understand what I’m doing wrong here.

    Remove those *** from https: to download.

    h*t*t*p*s://dl.dropboxusercontent.com/u/43020976/Scirra%20forums/pin%20to%20family/pin_to_family_example_r233.capx

    Any kind of help is highly appreciated.

    -M-

  • Link is broken. (yes with * removed lol)

  • Mithrill

    I think there are two problems.

    1. The Blobs you created in the reapeat-loop are only accessible after the loop.

    2. The pin-behavior belongs to the Family

    It is like you said, you need a family to have two objects for pinning.

    I made an example:

    https://drive.google.com/file/d/0B5FlDY ... sp=sharing

  • Asmodean

    Thank you so much! You helped me a lot ^^

    -M-

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm trying to achieve this same thing but I'm using a Function to spawn the object by name in order to generalize the EnemySpawn function.

    Is there a way to accomplish this since I can't Pick all "Function.Param(0)"

    SOLVED

    I just added a blank sub-event with Set healthBar to Enemies.imagepoint 1

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