How do I fix this bullet angle error?

Get help using Construct 2

Post » Mon Dec 05, 2016 9:17 pm

Message: Vodakman can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hello.

Well, the tile is self explanatory. Nothing really to say here.
Once I aim the gun on the left side while my character is turned to the left side and shoot it, the bullets go to the right side instead of the left.
I've tried using the "Set Mirrored" event and some other stuff but it didn't work for some reason.

Here's the image of some of the gun event stuff:
Image




.capx link:
http://www.mediafire.com/file/fskrw9d3k8qe9r5/Platformer.capx

EDIT: I forgot to mention that the gun is aimed with the mouse, and not just the A and D keys.
Last edited by Vodakman on Tue Dec 06, 2016 8:42 am, edited 1 time in total.
B
7
Posts: 34
Reputation: 345

Post » Mon Dec 05, 2016 10:08 pm

@Vodakman on the "is not mirrored" sub event after you spawn the bullet just ad another action bellow : "set bullet speed" to -600 wich is the speed you choose for your bullet but with - so the bullet travels to the opposite direction
B
38
S
22
G
64
Posts: 242
Reputation: 36,072

Post » Mon Dec 05, 2016 10:20 pm

@Vodakman
@tarek2

setting bullet speed to a minus value won't fix the sprite. I usually set the angle of the bullet to the player angle after spawning.

1. Spawn bullet
2. Set angle of bullet to player angle

This should rotate the bullet 180° if player is mirrored.
B
34
S
9
G
3
Posts: 206
Reputation: 7,851

Post » Tue Dec 06, 2016 6:36 am

MACPK wrote:@Vodakman
@tarek2

setting bullet speed to a minus value won't fix the sprite. I usually set the angle of the bullet to the player angle after spawning.

1. Spawn bullet
2. Set angle of bullet to player angle

This should rotate the bullet 180° if player is mirrored.


@MACPK normally you are right, i tried that first with his capx but it didnt work, i was tired and i didnt notice that the gun is the one pointing in the wrong angle when the player is mirrored
B
38
S
22
G
64
Posts: 242
Reputation: 36,072

Post » Tue Dec 06, 2016 8:56 am

Yeah, I forgot to mention that the gun is aimed by the mouse, if that's the problem.
Also, another problem happens when I'm mirrored, the gun aims weirdly, not sure why though.
B
7
Posts: 34
Reputation: 345

Post » Tue Dec 06, 2016 9:40 am

Vodakman wrote:Yeah, I forgot to mention that the gun is aimed by the mouse, if that's the problem.
Also, another problem happens when I'm mirrored, the gun aims weirdly, not sure why though.


@Vodakman yea a noticed that today, I done a quick fix let me know if is that what you need

new capx: https://www.dropbox.com/s/841hbugbxvtw30l/Platformer2.capx?dl=0
B
38
S
22
G
64
Posts: 242
Reputation: 36,072

Post » Tue Dec 06, 2016 10:02 am

Message: Vodakman can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
tarek2 wrote:
Vodakman wrote:Yeah, I forgot to mention that the gun is aimed by the mouse, if that's the problem.
Also, another problem happens when I'm mirrored, the gun aims weirdly, not sure why though.


@Vodakman yea a noticed that today, I done a quick fix let me know if is that what you need

new capx: https://www.dropbox.com/s/841hbugbxvtw30l/Platformer2.capx?dl=0


Yeah, that's it, thanks!
B
7
Posts: 34
Reputation: 345


Return to How do I....?

Who is online

Users browsing this forum: goodboy69 and 56 guests