How do I limit the turret rotation (arc)?

Get help using Construct 2

Post » Sat Jul 25, 2015 3:31 am

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.
B
4
S
1
Posts: 2
Reputation: 504

Post » Sat Jul 25, 2015 6:42 am

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.
B
52
S
24
G
18
Posts: 295
Reputation: 13,090

Post » Sun Jul 26, 2015 4:32 pm

Thanks, I'll try that. I really wish this was something in the behaviour of the turrets.
B
4
S
1
Posts: 2
Reputation: 504


Return to How do I....?

Who is online

Users browsing this forum: mariusvm, zenox98 and 17 guests