How do I make object pinned to each thing?

0 favourites
  • 7 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I want for example to pin each sword to each knight.

    When I say: For each Knight, For each sword, on start of layout- sword pin to knight It doesn't work. Why?

  • If you have a sword created for each knight and placed over the necessary pin position it will work. So you need to make sure there's a sword present. You can either spawn one at the start and then pin it OR have a container for the knights and place a sword in there, in that case you only need to set its location correctly and then pin it.

  • What do you mean by "container"?

    I have many the same sword for many the same knights

  • Container behaviour - let's you kinda group objects.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you don't want to use containers then you need to assign a sword to each knight by each sword UID as a knight object variable. That way you can do a For Each Knight and pick sword by UID.

  • For each Knight, For each sword, on start of layout- sword pin to knight It doesn't work. Why?

    Could you post code that is closer to actual C2 code? The above logic is not possible. Even if I remove the 'on start of layout' part, it looks like you're assigning *all* swords to each knight.

  • to make this simple, put the sword over the knight

    +sword is overlapping knight

    +for each sword

    +for each knight

    ->pin sword to knight

    you can access the sword of each knight by using "pick by comparison" like this

    Pick sword which

    Knight.UID

    =

    Sword.pin.pinnedUID

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