[Solved] How do I pin objects of the same family correctly to eachother

0 favourites
  • 8 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Hey Folks :)

    I have a big "enemy" consisting of different parts which are all members of the same family. I place those parts in the visual editor of construct. There is also an family variable called "id", which is represented by 1 2 3 and so on in the image.

    Part 1 can move arround, so every other part should move with part 1 (pin position and angle) but part 4 can rotate and if done so part 5 should rotate with part 4.

    So my question is, how do i pin those objects to each other? My original thought was pinning those objects by overlapping but it seems i cant pick 2 different parts of the same family and pin the higher to the lower ID...

    Any suggestions on how to archive this? do i have to do this manually for each part? is it even possible? should i maybe move all the parts on its own in the same way, so i can rotate them seperatly? In this case, it would be easy to rotate part 4 but it would make for some complicated equasions to rotate part 5 in the same manner...

    kind regards

    Joschi

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • One option is is to have a second family with the same items as the first. That way you can pick the first in family A and the second in family B, and you have two unique objects to work with.

  • Hey blackhornet, thanks, i tryed that before but somehow did not manage to get it to work correctly, maybe i did something wrong, i will try again and post the result here!

  • Hmmm i cant wrap my head arround this >< maybe i should take a break.

    Here is a screenhot, basically the second part archives what i want but i want to do it somewhat automatically, so i dont have to do it for each part manually (there are a lot of parts...)

  • I wouldn't use the family name space. I would pin them on creation since they are picked when created.

  • newt, sorry, that doesnt make much sense to me... could you elaborate?

    I tryed everything putting the same object in 2 familys, but it just wont work the way i inted it to do... objects are pinned all to one or not at all even if i comapare ID`s

    in general its really simple what i want to do, basically

    IF endgegnerpart1 IS OVERLPPING endgegnerpart2 AND endgegnerpart1.id = endgegnerpart2.id2 -1

    sounds simple right? I dont get it why this just wont work...

  • dop2000 you are the best! I am working for such a long time now with construct 2 and still learning! :D Problem is, i mostly have 1 month a year to make games (its just an hobby, i whish it would be more) this works like a charm, i am pretty sure i can modify this for my game :)

    Thank you very much!

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