Image Point Moves on Mirror

Get help using Construct 2

Post » Fri Mar 22, 2013 6:26 am

I have hair that I'm pinning to a character's head at a specific image point. It aligns perfectly when facing right. When I mirror the character and the hair to walk left, the hair is offset by 10 or so pixels on the X (no offset on the Y).

I tried resetting the position of the hair to the image point to try to override it in case movement shifted it slightly, but it stays the same. When the character goes right again, it mirrors back to the perfect alignment.

It seems like the image points don't mirror perfectly. Has anyone else run into this? I saw a thread from 2 years ago about it, but it was using old terminology and didn't have a conclusion...
B
8
S
1
G
1
Posts: 37
Reputation: 1,326

Post » Fri Mar 22, 2013 8:16 am

Image points do mirror properly, but the pin behaviour doesn't update upon mirroring. So when you mirror the character, you need to update the hair's position and pin (and probably mirror it, too).
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Post » Fri Mar 22, 2013 4:36 pm

@geometrix I did update the hair's position and even tried unpinning and repinning, but I get the same results. When you say update the pin, is there a way to refer specifically to the pin? Like Hair.Pin.X or something?
B
8
S
1
G
1
Posts: 37
Reputation: 1,326

Post » Fri Mar 22, 2013 6:16 pm

Did you mirror the hair too?
B
54
S
28
G
18
Posts: 1,520
Reputation: 24,990

Post » Fri Mar 22, 2013 7:03 pm

@ramones hair is definitely mirrored. Steps:

onwalkright: (works)
set human = !mirrored
set hair = !mirrored

onwalkleft: (offset issue)
set human = mirrored
set hair = mirrored

Later tried:
onwalkleft: (still offset)
set human = mirrored
set hair = mirrored
set hair to human position at image pointGabeOfThrones2013-03-22 19:03:46
B
8
S
1
G
1
Posts: 37
Reputation: 1,326

Post » Fri Mar 22, 2013 8:05 pm

Sorry, by update I mean apply the pin (and position) again.

Example capx.
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Post » Fri Mar 22, 2013 9:48 pm

@geometrix Weird. That is the exact set of events I'm using. It's just not working for me.

Here's the capx.

Check out the "Idle" and "MirrorAccessories" functions on the Pathfinding Event sheet. The hair is random, and no hair is an option, so if you don't get any, just restart.GabeOfThrones2013-03-22 21:50:35
B
8
S
1
G
1
Posts: 37
Reputation: 1,326

Post » Fri Mar 22, 2013 10:15 pm

But you weren't updating the pin and position when updating the character facing left or right.

I did that, but then the hair was in the wrong position and I realised (after too much fiddling :P) that you didn't have image point 1 on the walking animation, so I created that too.

Updated capx.
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Post » Fri Mar 22, 2013 10:34 pm

@geometrix wow. thanks a ton for going to that effort! i forgot i reimported the walk and it cleared the image point for that. i'm not sure i understand why the hair needs to be re-pinned... it's already pinned. I thought setting the position was all that was necessary...

Thanks again.
B
8
S
1
G
1
Posts: 37
Reputation: 1,326

Post » Fri Mar 22, 2013 10:50 pm

Yeah, I don't get it either. In isolated testing, redefining the position of the pinned object has zero effect (since pin is basically "set position every tick", so it can't be overridden), so it's not like that's what's buggering up the behaviour.

But then, you shouldn't be able to reposition the object at all, in that case.

It must be the mirror function that causes this hiccup, but I don't know if it's a bug or just a result of the the way that the function works.

In truth, I think I've confused myself now :P

Perhaps @Ashley or someone else more familiar with things could shed some light on this?
B
56
S
15
G
10
Posts: 910
Reputation: 11,942

Next

Return to How do I....?

Who is online

Users browsing this forum: michaelverdi and 29 guests