0 Favourites

How do connected objects inherit parent's move restrictions?

  • Hello. I had this problem throughout many projects but now I can't evade it.

    When an object is attached to another object via everytickish positioning and you drag it around - everything seems fine until you restrict parent object's move area. On the GIF below you may see how square can't pass the border but connected sprites keep following cursor even though Mouse.X isn't mentioned in event sheet. Sprites go back to parent eventually (in few ticks or more) but then they go to it's "ghost" position again. I assume some engine limitations, but still hope for a solution.

    What I CANNOT do:

    • Apply pin behavior: I'm building kind of puppet rig with many parts connected and pin isn't compatible with many types of moving and rotating I'm using;
    • Restrict coordinates for each part in particular: there are reeeally lot of them and their origins aren't static.
  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Are you using drag and drop behaviour? Seems like a limitation with drag, because it is still in drag every time you move it thinks the object position is the position of the mouse cursor. A possible fix is to set the other objects to X=300 as well.

  • Drag'n'Drop is most smooth one with collisions. Tried following cursor, but there are own issues.

    Sorry for the size, forum doesn't support spoilers.

  • You set the position of the 'followers' before setting the final position of that base object.

    Should work if you switch both events.

  • On the event for x<300 if you set all the other objects to x=300 as well as the square then it's smooth, is that what you want to happen?

  • >99Instances2Go

    Worked like magic! Can it really be that easy?

    >plinkie

    That would solve, but every sprite has own origin and calculating relative coordinate for each is quite painful.

    Many thanks, everyone!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
564 105,179
rexrainbow's avatar
rexrainbow
Unread hot topic
99 10,128
karshinkoff's avatar
karshinkoff
Unread hot topic
167 14,485
DMT2005's avatar
DMT2005