Pin to object Bug

Bugs will be moved here once resolved.

Post » Wed Jan 07, 2015 6:53 am

Problem Description
Object won't pin to another object.

Attach a Capx
PinBug.capx


Description of Capx
The capx has two objects that you can drag into containers with slots.

Steps to Reproduce Bug
  • Drag the right object onto a slot in the left container.
  • Drag that container around.

    Observed Result
    The object doesn't get pinned to the slot. It incorrectly gets pinned to the other slot object in the other container.
    I have it so that the uid of the slot gets displayed in a Text object, you can see the corrent UID get shown, but in the debug, the incorrect UID is used somehow (see the pinned object property in debug) !?

    Expected Result
    It should get pinned to the slot in the left Container and move with it.

    Affected Browsers
    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

Operating System and Service Pack
win vista sp 2

Construct 2 Version ID
r193
You do not have the required permissions to view the files attached to this post.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Wed Jan 07, 2015 9:24 am

Here's a simpler capx that isolates the issue..
PinBug2.capx

Drag the brown object to the other blue object to pin it.. It displays correct UID, but it gets pinned to the incorrect object.
It appears as if it isn't taking into account the relation of the containers (sprite3 should be picked with the sprite2 that family1 collides with).

from the manual:
"If a condition picks one object in a container, every other associated object in its container is also picked."

But it's not pinning it to the picked object.
You do not have the required permissions to view the files attached to this post.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Wed Jan 07, 2015 11:50 am

I can't see any problem in PinBug2.capx, it seems to be working fine - whichever way round I do it it pins to the group it touched. Am I doing something wrong?
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,250

Post » Wed Jan 07, 2015 4:19 pm

@Ashley , have you tried dragging one to the other object, and not just the one it is next to? One should be able to pin to both, not just the one it is next to. Then drag the blue objects to move with the pin attached.
For me, one only gets pinned to the object is spawns next to, but it should pin to any of them.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Wed Jan 07, 2015 4:29 pm

@Ashley , here's a gif showing the problem.
I drag the object over to the other and it doesn't attach like it should, then I drag the other object to the same object and it does.
Image
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842

Post » Mon Jan 12, 2015 3:53 pm

It doesn't appear to be to do with families, since if you replace Family1 in the events with Sprite then it works the same. There is a fundamental conflict in the events here: Sprite, Sprite2 and Sprite3 are all in a container, so will always pick together. If Sprite collides with a Sprite2 from a different container, as per the normal working of events, both instances involved in the collision are picked, and therefore due to containers all six objects are picked. Now your "Pin to Sprite3" action is ambiguous, since there are two Sprite3 instances picked, so it's going to (arbitrarily) go with one of them.

I don't see evidence of a bug here. I think you just want to avoid using containers, since in this example they seem to be working against you.
Scirra Founder
B
387
S
230
G
87
Posts: 24,249
Reputation: 192,250

Post » Mon Jan 12, 2015 6:38 pm

Using containers the way I have is necessary.
I had found a workaround to this. Placing sprite3 into its own family, and then picking that family based upon the uid from the collision works. It then gets pinned to the correct object.
B
41
S
19
G
65
Posts: 1,085
Reputation: 37,842


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests