Feature Request: Turret - Min/Max rotation

0 favourites
  • 6 posts
From the Asset Store
15 High Quality SoundTracks, and 10 Fanfares for your game! :D
  • Hi,

    I have what I thought would be a simple problem to fix, the thread is here https://www.scirra.com/forum/turret-behaviour-set-max-rotation-angle_t106442

    [attachment=0:3mov7i1q][/attachment:3mov7i1q]

    The turrets go through the floor. This game is using physics, so setting the floor to solid does not help.

    To fix this issue I'd really like to be able to set the min and max turret rotation in the turret behaviour dialogue.

    Or have some way for the turret (not using physics) to stop rotating when it hits something, in this case the floor - which is using physics so the player ship which also uses physics can interact with it.

    I've just gone through the javascript sdk docs, but I don't feel confident trying to add this behaviour myself. Although I can see where it could be done in the turret behaviours runtime.js, possibly in

    // Rotate towards target

    if (this.rotateEnabled)

    Anyhoo, this addition to the turret behaviour would be great (for me!). Not sure if anyone else has a requirement for it, but I'd be surprised if not.

    Thanks

    Nick .

  • A problem shared is a problem halved ... Just had a thought - I'll try disabling the turrets turret behaviour when player.y > someValue, then enabling it again when player.y < someValue.

  • Nah, won't work with turrets at vastly different Y positions.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could set individual angle limits for each turret - a bit of a pain but probably the most efficient... Or you could alter the collision polygon for your turrets and stop them from rotating on collision with the floor. You'd probably have to add a rotate-until-not -overlapping algorithm as well or the turrets could get stuck. Last option - you could add a sensor and pin it to each turret if you don't want to change the collision polygon - more complex to manage...

  • Thanks Colludium

    I've basically decided to just remodel the turrets, so that the turrets rotates around a ball, then attach something thin to the ball to fix it to the ground. Doesn't look as good, but it's a work around I guess.

  • I'd really like to be able to set the min and max turret rotation in the turret behaviour dialogue.

    Signed.

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