Locks a vehicle turret to a specific azimuth and elevation relative to the vehicle hull. While locked, the turret is no longer able to move or have its gunner engage targets (while still being able to fire).
|Syntax:||[vehicle, turret, azimuth, elevation, smooth] call fn_vbs_lockTurretDir|
|Syntax:||[vehicle, turret] call fn_vbs_lockTurretDir|
When using functions in VBS versions older than 3.4, certain limitations and requirements should be kept in mind - the main ones being that capitalization of the function name is crucial, and that #include "\vbs2\headers\function_library.hpp" has to be included in every script that utilizes it. More Category VBS Scripting Functions.
[_veh, , 180, 10] call fn_vbs_lockTurretDir; // Lock turret to vehicle 6 o'clock sleep 60; [_veh, ] call fn_vbs_lockTurretDir // Unlock the turret
|See also:||turretLockedOn, setWeaponDirection, setFireArc|
|Problems:||This function is not meant to be be called every frame. It depends on time delays and spawned looping scripts every time it is called. If you need per-frame control over a turret, use setWeaponDirection instead, combined with some math to convert from relative to absolute elevations.|