How do I limit the turret rotation (arc)?

  • How can I limit the rotation (arc) of a turret? Picture a spaceship, the turrets on the left (or right) side should only turn until certain degree, enemies that go beyond this angle should be ignored and the turret should find a new target (within her "firing" angle). I really wish there was this option in the turret behaviour.

  • I don't think I ever tried this in C2 so can't guarantee it'll work, but as I recall in CC I managed to do something like this using two objects in a container (let's call these Arc and Turret). Arc was basically an invisible doodad that I used to reference the angle to determine a cone of fire, Turret was just the turret. If Turret turned too far in relation to Arc, it would unacquire target, rotation would be disabled and it would manually get rotated back within its field of view.

    Perhaps you can also use Line of Sight behavior on Arc to augment it, I didn't get very far in my experiments unfortunately. I wouldn't say this is the most elegant solution, but it worked ok for the limited function I needed it for.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, I'll try that. I really wish this was something in the behaviour of the turrets.

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