Issue with Turret Rotation

0 favourites
  • 6 posts
From the Asset Store
10 turrets rendered in 3D with top down and menu views. Three upgrade levels per tower.
  • Hello I need help with the enemy weapon rotation. If the player stands too close to the enemies their weapons become flipped (circled red in the 1st picture) while the other side has the correct weapon orientation.

    When they are all on one side and not split between the player the turret orientation is fine.

  • Can anyone help? I can't figure this out lol

  • Hi there.

    So... I tweaked it a lot, hope it helps.

    github.com/dupuqub/constructs/blob/master/Shooter.c3p

    There are many cleaner cuts to the code and to the actors' hitboxes. I wasn't really sure where was the bug so I had to keep cleaning wherever I could. The bug now is gone, also the other bug is gone (the one that flickered the screen when your mouse got centered).

    Also, maybe I found a Construct bug while fiddling with your code, so thanks for that.

    github.com/Scirra/Construct-3-bugs/issues/4047

    It may turn out to not be a bug after all, but I'll update this thread when we get the results.

    Either way, I'd recommend for you to check the file I posted in the bug report because it shows a very sleezy trap in the ELSE statement behavior.

    Best of luck and feel free to ask anything.

  • dupuqub It's not a bug. "Monsters X>Player.X" condition picks Monsters instances. And if at least one instance is picked, than this condition is considered true and the Else block will not be executed. Only when all monsters are to the left from the player, the Else block will run.

    So you need two events - "Monsters X>Player.X" and "Monsters X<Player.X"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks!

    That's a nice catch. Just closed the bug.

  • Hi there.

    So... I tweaked it a lot, hope it helps.

    https://github.com/dupuqub/constructs/blob/master/Shooter.c3p

    There are many cleaner cuts to the code and to the actors' hitboxes. I wasn't really sure where was the bug so I had to keep cleaning wherever I could. The bug now is gone, also the other bug is gone (the one that flickered the screen when your mouse got centered).

    Also, maybe I found Construct bug while fiddling with your code, so thanks for that.

    https://github.com/Scirra/Construct-3-bugs/issues/4047

    It may turn out to not be a bug after all, but I'll update this thread when we get the results.

    Either way, I'd recommend for you to check the file I posted in the bug report because it shows a very sleezy trap in the ELSE statement behavior.

    Best of luck and feel free to ask anything.

    Wow thanks so much for the help! And thanks for the tweaks as well! I've been stuck on this for a bit now and I can finally move on now lol. Thanks again!

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