How do connected objects inherit parent's move restrictions?

Get help using Construct 2

Post » Thu Jan 26, 2017 3:44 pm

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.

Image
Image
B
8
S
1
G
2
Posts: 19
Reputation: 938

Post » Thu Jan 26, 2017 4:02 pm

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.
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Thu Jan 26, 2017 4:46 pm

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.
Image
Image
Image
Image
B
8
S
1
G
2
Posts: 19
Reputation: 938

Post » Thu Jan 26, 2017 4:57 pm

Image

You set the position of the 'followers' before setting the final position of that base object.
Should work if you switch both events.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Jan 26, 2017 4:59 pm

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?
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Thu Jan 26, 2017 5:06 pm

>99Instances2Go
Worked like magic! Can it really be that easy? :shock:
>plinkie
That would solve, but every sprite has own origin and calculating relative coordinate for each is quite painful.

Many thanks, everyone!
B
8
S
1
G
2
Posts: 19
Reputation: 938


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests