{"name":"animateBay","operator":null,"title":"animateBay","type":"command","url":"https://community.bistudio.com/wiki/animateBay","revid":347988,"updated":"2023-11-08T10:17:14Z","groups":["Animations","Vehicle Loadouts"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"1.70"}],"since":{"game":"arma3","name":"Arma 3","version":"1.70"},"arma3_since":"1.70","branch":null,"locality":{"argument":"global","effect":"local","server_exec":false},"exec":null,"description":"Forces animation of bay to given state, -1 for reset to engine handling, can cause weapon inoperative, because weapon is released when bay state == 1.\n\n> [!NOTE]\n> While there is no getter to read the animation phase of the given bay, the animationPhase command can be used with the individual bay door name from animationNames as a workaround (See #Example 3).","syntaxes":[{"syntax":"vehicle animateBay [bay, animphase, instant]","since":null,"effect":null,"exec":null,"params":[{"name":"vehicle","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"vehicle: Object"},{"name":"bay","type":"Number","optional":false,"default":null,"description":"bay index (index starts from 1 and different from pylon index)","types":["Number"],"since":null,"text":"bay: Number - bay index (index starts from 1 and different from pylon index)"},{"name":"animphase","type":"Number","optional":false,"default":null,"description":"animation phase in range 0..1","types":["Number"],"since":null,"text":"animphase: Number - animation phase in range 0..1"},{"name":"instant","type":"Boolean","optional":true,"default":"false","description":"animate immediately","types":["Boolean"],"since":null,"text":"instant: Boolean - (Optional, default false) animate immediately"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"vehicle","types":["Object"]},"right":{"text":"[bay, animphase, instant]","types":["Array"]}}],"examples":[{"text":"```sqf\nvehicle player animateBay [1, 0.5];\n```","code":["vehicle player animateBay [1, 0.5];"]},{"text":"```sqf\nvehicle player animateBay [1, 1, true];\n```","code":["vehicle player animateBay [1, 1, true];"]},{"text":"Getter example, here for the UCAV Sentinel:\n\n```sqf\nucav animateBay [1, 1];\n// can be checked with\nucav animationPhase \"weapons_bay_l_1\";\n// or\nucav animationPhase \"weapons_bay_l_2\";\n```","code":["ucav animateBay [1, 1];\n// can be checked with\nucav animationPhase \"weapons_bay_l_1\";\n// or\nucav animationPhase \"weapons_bay_l_2\";"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Arma 3: Vehicle Loadouts","getCompatiblePylonMagazines","getPylonMagazines","setAmmoOnPylon","ammoOnPylon","animatePylon","setPylonsPriority","setPylonLoadout"],"notes":[],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Animations","Command Group: Vehicle Loadouts","Introduced with Arma 3 version 1.70","Scripting Commands","Scripting Commands: Local Effect"]}