setTurretLimits: Difference between revisions
Killzone Kid (talk | contribs) No edit summary |
Killzone Kid (talk | contribs) No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 8: | Line 8: | ||
|eff= global | |eff= global | ||
|descr= Sets the rotation and elevation limits for the given turret. The limits are relative to model | |descr= Sets the rotation and elevation limits for the given turret. The limits are relative to model orientation of the turret. For example to allow 360 degree turning it is enough to set turn limits to (-180, 180). The limits can only be set within the limits defined in config and cannot exceed them. To reset to config defaults pass the turret argument only (Example 2). | ||
|gr1= Turrets | |gr1= Turrets | ||
| Line 21: | Line 21: | ||
|p5= minElev: [[Number]] - from 0 to -angle in degrees (down) | |p5= minElev: [[Number]] - from 0 to -angle in degrees (down) | ||
|p6= maxElev: [[Number]] - from 0 to +angle in degrees (up) | |p6= maxElev: [[Number]] - from 0 to +angle in degrees (up) | ||
| | |p7= soft: [[Boolean]] - (Optional) [[true]] to gradually move turret to the new limits (if turret is currenty oriented out of new limts). [[false]] to snap to the new limits. Default: [[false]] | ||
| | |p7since= arma3 2.22 | ||
|r1= [[Nothing]] | |r1= [[Nothing]] | ||
Latest revision as of 22:08, 21 October 2025
Description
- Description:
- Sets the rotation and elevation limits for the given turret. The limits are relative to model orientation of the turret. For example to allow 360 degree turning it is enough to set turn limits to (-180, 180). The limits can only be set within the limits defined in config and cannot exceed them. To reset to config defaults pass the turret argument only (Example 2).
- Groups:
- Turrets
Syntax
- Syntax:
- vehicle setTurretLimits [turret, minTurn, maxTurn, minElev, maxElev, soft]
- Parameters:
- vehicle: Object - vehicle the turret belongs to
- turret: Array - turret path
- minTurn: Number - from 0 to -angle in degrees (left)
- maxTurn: Number - from 0 to +angle in degrees (right)
- minElev: Number - from 0 to -angle in degrees (down)
- maxElev: Number - from 0 to +angle in degrees (up)
- since
2.22 - soft: Boolean - (Optional) true to gradually move turret to the new limits (if turret is currenty oriented out of new limts). false to snap to the new limits. Default: false
- Return Value:
- Nothing
Examples
- Example 1:
- m2 setTurretLimits [[0], -45, 45, -10, 10];
- Example 2:
- m2 setTurretLimits [[0]]; //reset
- Example 3:
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note