Best way to attach a weapon and have it mirror right?

Get help using Construct 2

Post » Tue Jan 27, 2015 8:16 pm

Every time I attach a sword or gun to my platform character I run in to the same issue. I try to have the character move in the other direction by using the "mirror=true" function but the gun/sword/wep never mirrors correctly. I'm not in front of my computer with C2 on it or I'd attach an example but it's really boggling my brain. I want to be able to swing a sword facing the right and then turn left and swing it exactly the same just mirrored.

Hopefully someone knows what I'm talking about and has a quick fix :/

Thank you.
B
12
S
4
G
2
Posts: 132
Reputation: 1,749

Post » Tue Jan 27, 2015 8:18 pm

I should also mention that I'm using the Pin behavior on the weapon, pinning it to the character at the start of layout angle and direction I think the option is called and then I also have it mirror.

The issue seems to be that it mirrors but isn't attached at the right spot when it does. It scoots it back or something.
B
12
S
4
G
2
Posts: 132
Reputation: 1,749

Post » Tue Jan 27, 2015 10:35 pm

It won't mirror properly if you use pin. Instead, on the sprite you're pinning to, create another image point on the sprite called "weapon", and then every tick set the position of your weapon sprite to Player.ImagePointX("Weapon") & Player.ImagePointY("Weapon"). Then, once you mirror the both sprites, they should mirror properly.
B
40
S
12
G
1
Posts: 532
Reputation: 4,147


Return to How do I....?

Who is online

Users browsing this forum: Artcadev, totoe, Uk4dee and 28 guests