{"name":"setTurretLimits","operator":null,"title":"setTurretLimits","type":"command","url":"https://community.bistudio.com/wiki/setTurretLimits","revid":379081,"updated":"2026-09-27T07:57:22Z","groups":["Turrets"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"2.12"}],"since":{"game":"arma3","name":"Arma 3","version":"2.12"},"arma3_since":"2.12","branch":null,"locality":{"argument":"local","effect":"global","server_exec":false},"exec":null,"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).","syntaxes":[{"syntax":"vehicle setTurretLimits [turret, minTurn, maxTurn, minElev, maxElev, soft]","since":null,"effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":"vehicle the turret belongs to","types":["Object"],"since":null,"text":"vehicle: Object - vehicle the turret belongs to"},{"name":"turret","type":"Turret Path","optional":false,"default":null,"description":"turret path","types":["Turret Path"],"since":null,"text":"turret: Turret Path - turret path"},{"name":"minTurn","type":"Number","optional":false,"default":null,"description":"from 0 to -angle in degrees (left)","types":["Number"],"since":null,"text":"minTurn: Number - from 0 to -angle in degrees (left)"},{"name":"maxTurn","type":"Number","optional":false,"default":null,"description":"from 0 to +angle in degrees (right)","types":["Number"],"since":null,"text":"maxTurn: Number - from 0 to +angle in degrees (right)"},{"name":"minElev","type":"Number","optional":false,"default":null,"description":"from 0 to -angle in degrees (down)","types":["Number"],"since":null,"text":"minElev: Number - from 0 to -angle in degrees (down)"},{"name":"maxElev","type":"Number","optional":false,"default":null,"description":"from 0 to +angle in degrees (up)","types":["Number"],"since":null,"text":"maxElev: Number - from 0 to +angle in degrees (up)"},{"name":"soft","type":"Boolean","optional":true,"default":null,"description":"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","types":["Boolean"],"since":"arma3 2.22","text":"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"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"vehicle","types":["Object"]},"right":{"text":"[turret, minTurn, maxTurn, minElev, maxElev, soft]","types":["Array"]}},{"syntax":"vehicle setTurretLimits [turret]","since":null,"effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":"vehicle the turret belongs to","types":["Object"],"since":null,"text":"vehicle: Object - vehicle the turret belongs to"},{"name":"turret","type":"Turret Path","optional":false,"default":null,"description":"turret path (to reset)","types":["Turret Path"],"since":null,"text":"turret: Turret Path - turret path (to reset)"}],"returns":null,"form":"binary","operator":null,"left":{"text":"vehicle","types":["Object"]},"right":{"text":"[turret]","types":["Array"]}},{"syntax":"","since":null,"effect":null,"exec":null,"params":[],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":null,"operator":null,"left":null,"right":null}],"examples":[{"text":"```sqf\nm2 setTurretLimits [[0], -45, 45, -10, 10];\n```","code":["m2 setTurretLimits [[0], -45, 45, -10, 10];"]},{"text":"```sqf\nm2 setTurretLimits [[0]]; //reset\n```","code":["m2 setTurretLimits [[0]]; //reset"]},{"text":"```sqf\nm2 setTurretLimits [[0], -45, 45, -10, 10, true];\n```","code":["m2 setTurretLimits [[0], -45, 45, -10, 10, true];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["getTurretLimits","setTurretOpticsMode","turretLocal","selectWeaponTurret","lockCameraTo"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Turrets","Introduced with Arma 3 version 2.12","Scripting Commands","Scripting Commands: Global Effect"]}