No turret rotation = Turret won't shoot?

This forum is currently in read-only mode.
From the Asset Store
Shoot balls to destroy as many blocks as possible, at each stage the game will become more difficult.
  • I posted it here because I'm not sure if you have to do something special if you want your turret to shoot without it rotating to the targets direction.

    Ok, so I'm making a missile silo, with turret behavior and no rotation.

    If turret rotation is enabled it rotates towards target and looks stupid like hell.

    If turret rotation is disabled, it does nothing! Targets just go by it, it does nothing.

    Is there something special I need to do to enable the turret to fire without the rotation of the turret itself?

    Oh, and the build is 0.94.2, in case future people have this problem but just can't solve it by looking here.

  • Further studies show that it indeed acquires target, but doesn't do anything else if it's not allowed to rotate.

    I put the following condition on the turret:

    +On target acquired

    • Turret: play animation
    • Turret: set animation to fire

    And it does the firing animation!

  • Ok, I worked out a temporary solution. I made a private value with name "reload" with it's initial value being the wanted reload time, and made this condition.

    On the turret:

    +Has target

    +Every turret.Value('reload') milliseconds

    -turret: set animation to 'fire'

    -turret: play animation

    -turret: spawn object missile (pic here) on layer 1 (image point 'fire'

    -missile: set 'target' to turret[Turret].TargetUID

    It isn't as perfect as the normal turret firing, as with this setting it takes the reload time you want to shoot the first time, unlike in a pre-set turret, which fires the first shot immediality when it sees the target.

  • If you dont want turret to rotate change in Property -> Angle -> Rotation=No Rotations. And set "Turret rotation=true".

  • Oh, for christs sake! That did the trick!

    Ashley, could you give me a title?

    It would be: The Turret-fool.

  • The turret movement is coded to not trigger "On shoot" unless its within something like 1 degree of the target. This means a machine gun with turret movement isnt going to randomly spray bullets forwards while it rotates to the target - it only shoots AT it.

    So yeah, Doppel's on the right lines, make the rotate speed really high and turn off the Sprite's rotation and the Turret will be happy it's pointing at its target.

  • I see this post is very old, 2008 or 2009 but I am currently having this same issue. The solution given is for Construct 1 I believe or at least for a previous version of Construct as there is no option in Construct 2 to disable animation from a sprites property. I want to create towers as my turrets and have bullets spawn from the towers but do not want the towers to rotate. Presently I spawn a separate turret sprite that overlaps my tower and rotate it. Is there a way to not rotate my tower but still target enemies?

  • juduncan Unfortunately you'll likely need to give the turret behavior to an invisible sprite and put it in the container of the turret sprite to avoid C2 from rotating the image I believe.

  • Thanks, this is what I am presently doing just seemed like there was a better solution.

  • Same problem :)

    is there simple way to do it?

    HELP:)

    THANKS!:)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • [FIXED]I have the same problem and solved it by this. I didn't use turret at all. I just added even "Every X seconds". Then action I added to spawn a new object (the bullet). Then the next action just below is set bullet angle to "atan((player.y - enemy.y)/(player.x-enemy.x))". Then I noticed this only works well when the player is on the right side of the enemy other wise its 180 degrees off. So I did the following. Every X seconds sits alone with two sub events. First sub is System compare two values (player.x > enemy.x). For this sub put the two actions spawn bullet and set bullet angle to "atan((player.y - enemy.y)/(player.x-enemy.x))" The second sub is "Else" and has two actions, spawn bullet and set bullet angle to "atan((player.y - enemy.y)/(player.x-enemy.x)) - 180".

    This seemed to work fine for me. Just a little bit of trig and some testing.

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