Pinned Objects do not mirror with parent

Bugs will be moved here once resolved.

Post » Sun May 05, 2013 2:33 am

The only way to get pin to work again after mirroring its parent is to manually unpin the object, update its position to the image point again, and repin it. So the image points themselves appear to be mirroring correctly, but the pinned objects are not following suit. Pinned objects *will* follow any other type of motion / rotation / etc.

In the unlikely even that a change of this type could potentially break legacy projects which depend on mirror not updating the pinned object's position, could we at least have a Pin Option when an object is pinned along the lines of "Respect Parent Mirroring"?

I'm using the workaround currently, but the problem with this is that I have some objects which have N number of image points and the objects that are pinned are also fairly dynamic (mostly belonging to families but occasionally different), having to reset this stuff all the time can get kind of frustrating.

Link to .capx file (required!):
Pin Mirror Capx

Steps to reproduce:
1. Create parent object
2. Spawn child object and pin to parent
3. Mirror parent

Observed result:
Child does not mirror with parent, it remains in the same position.

Expected result:
Child should mirror with parent.

Operating system & service pack:
Windows 7 64-bit

Construct 2 version:
Release 126    
Posts: 232
Reputation: 6,244

Post » Tue May 07, 2013 3:02 pm

I think all you want is a single event that says "Every tick, position child to Master imagepoint "SpawnPt" and set angle to Master.angle".

If we make mirroring affect the pin, then shouldn't flipping also affect the pin? If not why not, and if so how would that work? The pin behavior doesn't know you're trying to attach it to an image point, it just preserves the relative distance and angle. It's such a simple behavior and trivial to reproduce in events (in this case one event does it), so I think it's fair to say if the behavior doesn't do what you need, rebuild it with events.
Scirra Founder
Posts: 24,134
Reputation: 190,591

Post » Thu May 09, 2013 3:36 am

@Ashley, I can understand that. I created a PinFamily whose objects have attributes:
IsPinned (bool)
Owner (UID)
ImagePtName (string)

Then I just have a single statement that repositions any objects on layout in PinnedFamily with IsPinned = Enabled.

That way whenever I spawn an object I want pinned, I can just set those attributes on the object, and the game will handle pinning them.

Posts: 232
Reputation: 6,244

Post » Wed Jul 17, 2013 7:58 am

Got the same problem, so thought i'd ask here instead of making a new thread.

I've got a marionette that's made up of multiple body parts pinned together and then pinned to a base image that acts as collision.

I've got it set up so that the base image mirrors based on whether the pathfinding is moving left or right. I've tried cacotigon's method of unpinning, updating the pin position/master.Angle and then reattaching and it doesn't react.

Is there any idea if the above solution of creating a family would work? I've been trying to find a solution that would preserve the relative attachment of the segments but to no avail.

Posts: 6
Reputation: 212

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests