Gordo1958's Forum Posts

  • 4 posts
  • blackhornet, Thanks for your reply. Your solution works for this specific case, but you are kinda "misusing" the animation system to get your result. What if you want to have the buttons and/or shadows animated?

    dop2000 Thanks for the really detailed reply! The pin behaviour solution looks like the logically cleanest solution for now, but what if I don't want to have the objects pinned physically together? The same goes for the "pick nearest" solution. May work for some cases, yes. But I just need a logical reference, not based on distance or whatever...

    Another example:

    I have the family "Balls"

    I have the family "Ball_Icons", which show every different kind of ball inside the GUI.

    If you click one "Ball" instance, the respective "Ball_Icon" should disappear.

    E.g. I click the Basketball, the basketball icon disappears.

    Sidenote: Every Ball is animated, Every Ball_Icon is animated, Icon and Ball should not physically pinned together, Positions and distances are random

    This sounds like a very specific thing, but the core problem is: Logically referencing two objects without big overhead. Of course there are plenty of hacks/ways to do it, but there most be a clean solution, since its one of the most crucial fundamentals of a gameengine. Maybe I don't get it right since I am a Construct 2 Newb

  • Thanks for your answer.

    By "use an instance variables to pair objects" you do the same as me, which I've stated as "messy workaround".

    I just bumped into the same problem again. I have 3 different buttons, each one with a shadow (separate object), and I want the shadow to disappear when the button is clicked -> There is no clean way to do this in Construct 2 afaik.

  • Thank you veeery much for pointing out containers 99Instances2Go.

    So I know how to create a container with e.g. "Football" which references "Football_Indicator". But how do I create a generic familiy which references another family?

    For my example: Family "Balls" references Family "Indicators".

    When I pick the object Football, I get the object Football_Indicator

    When I pick the object Golfball, I get the object Golfball_Indicator.

    When I pick the object Basketball, I get the object Basketball_Indicator.

    ... and so on for another 10000 types of balls

    How can I destroy/highlight or whatever (It's just about the picking) the respective indicator when I touch an object?

    Thanks again for helping me out - to finally understand the fundamentals of construct

    For now I have done a really messy workaround. This can't be the solution... I just post it here to make the problem even more clear:

    • I have created a family variable "REFERENCE" in family Balls, and a family variable "REFERENCE" in family Indicators.
    • I have manually written e.g. "FOOTBALL" into the REFERENCE field of the Ball and the Indicator object
    • Then, whenever a ball was clicked, I iterated over all Indicators and checked if the indicator REFERENCE matched the Ball REFERENCE.

    PS: I have also done a small test setup project, but it seems I cant paste URLs here..

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi all,

    How can "link" objects together?

    Let's say I have 5 different sprites in the editor (e.g. football, tennis ball, golf ball, ...) which share some behaviour and therefore are grouped in a family ("Balls").

    I also have 5 different "Indicator" sprites in the editor (with different sizes to fit the respective ball). Now I want to move the indicators with the balls and show/hide them.

    My problem is not the moving or showing/hiding part, but the fundamental logic how to link Indicator A to ball A, Indicator B to ball B and so on.

    I hope you can point me out some tipps?

    Any hints appreciated!

    Thx a lot

  • 4 posts