Bullet not changing angle fast enough

Discussion and feedback on Construct 2

Post » Sat Aug 30, 2014 6:30 am

I'm not sure what to think of this one, and it only occurs when using a controller. You can see in this video that the first 3 times I shoot I am using the keyboard, the times where the bullet is weird, it's with a wireless 360 controller. Both events are identical as they both simply call the shoot function.

You can see at about 5 seconds I slow the video down and you can see what it's doing. It happens again towards the end of the video.

Now I've been working on this game for a few days, constantly checking it with a 360 controller and never saw this before. It happens in both node webkit and chrome.

Might just be how it is, but I wanted to check.

https://www.youtube.com/watch?v=0uVsI7- ... e=youtu.be
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Sat Aug 30, 2014 6:49 am

I notice some delays if the Sprite is created in a function, i think the firing of events within a function is somehow different to normal events.

How do you set the angle, is it within the same function as spawning the bullet?

I always use a separate On Create trigger for all the bullets/projectiles, and then I set their stats such as angle or any other variable.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Sat Aug 30, 2014 1:59 pm

It's the action directly after the spawn.
Image

I'll check out suggestions and see if it fixes it.

It's just odd that it only happens with the 360 controller. It doesn't show in the video, but it's consistent. Every time I fire with the controller, it does it. It looks flawless when I use the keyboard.

Took everything out of the function and it still does it with the controller. So weird.
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Sat Aug 30, 2014 2:51 pm

Try that same structure but replace angle of motion to just angle, it should work. :)
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Sat Aug 30, 2014 3:01 pm

Yes!! Thank you.

Any idea why? Obviously you had a reason for being so sure about that answer :).
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Sat Aug 30, 2014 3:06 pm

ArcadEd wrote:Yes!! Thank you.

Any idea why? Obviously you had a reason for being so sure about that answer :).


I've had that experience before. Angle of Motion command immediately after creation of a sprite needs a small delay after created to respond properly, the delay could fall within the same tic or not its quite random.

You can do a separate On Create Bullet => Set Angle of Motion and it works.

But set angle itself works always. ^_^b
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Sat Aug 30, 2014 3:25 pm

Thank you :). I'll put that tidbit in my brain.
B
101
S
32
G
11
Posts: 1,552
Reputation: 21,667

Post » Sun Aug 31, 2014 2:57 am

@ArcadEd - Also you you could try using the 'wait 0' trick for problems like this. I'm not sure if it would work in this particular instance, but it has saved me countless times with very similar problems.
B
28
S
8
G
5
Posts: 429
Reputation: 7,007


Return to Construct 2 General

Who is online

Users browsing this forum: BadMario and 6 guests