Bullet not changing angle fast enough

0 favourites
  • 8 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • 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.

  • 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.

  • It's the action directly after the spawn.

    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.

  • Try that same structure but replace angle of motion to just angle, it should work.

  • Yes!! Thank you.

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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • Thank you . I'll put that tidbit in my brain.

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)