How do I make my gun face away from me?

Get help using Construct 2

Post » Wed Jun 01, 2016 6:08 am

https://www.youtube.com/watch?v=uZMwe1Xifhw

I failed

My pinned gun works when i face to the left, but is behind me when i face right.

If I hold the walk left button (A) then try walking to the right (D) while holding A,
the gun points away instead of behind me. I need this scenario everytime.

But if I hold the walk right (D) button first and then try to walk left (A) , my sprite mirrors and my gun faces backwards
:cry:
B
36
S
22
G
2
Posts: 10
Reputation: 4,272

Post » Wed Jun 01, 2016 7:14 am

basically your event is remembering the old press down what i did was instead of press down i use press released that usually solve it.
B
52
S
24
G
6
Posts: 391
Reputation: 7,845

Post » Wed Jun 01, 2016 9:41 am

This didn't help, I have alot of events that govern the gun direction so i'm confused, I uploaded this so that I remember this thread

My capx file:
http://www.filedropper.com/wedjun1538am2016

I'll take another look at my event sheet before i say that I've tried everything
B
36
S
22
G
2
Posts: 10
Reputation: 4,272

Post » Wed Jun 01, 2016 11:31 am

Hey SimShady,

I had a look at your capx and the issue you are having comes from a few places. For a start off you have a ton of redundant/conflicting events for your gun control. I would remove practically all of them. Second you are trying to tie the direction of the gun to a keypress, which is in my experience a bad way of doing it. I usually tie the keypress to the direction of the character and then the direction of the character to the gun.

I messed with your capx and ended up with the screenshot below - this gives you a responsive correct gun position. I'm not saying this is perfect though :) I didn't have long. Maybe someone else will come up with something better!

http://i.imgur.com/2KTixKM.png
B
13
S
6
Posts: 130
Reputation: 1,553

Post » Wed Jun 01, 2016 11:39 am

Why not shift the guns origin on the X-as ?

Then you can spawn the gun on the players position.
You can pin it.
Or set it to that position every tick.
Mirror it when you mirror the player.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950


Return to How do I....?

Who is online

Users browsing this forum: Armench, Artcadev, farsen, Yahoo [Bot] and 14 guests