{"name":"underwater","operator":null,"title":"underwater","type":"command","url":"https://community.bistudio.com/wiki/underwater","revid":336959,"updated":"2023-01-04T16:44:17Z","groups":["Object Manipulation"],"status":"ok","replaced_by":[],"games":[{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma3","name":"Arma 3","version":"0.50"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Returns whether the object is fully underwater.\n\n> [!NOTE]\n> This command works well with Arma 3 mini-submarines, which was most likely the primary design goal.","syntaxes":[{"syntax":"underwater object","since":null,"effect":null,"exec":null,"params":[{"name":"object","type":"Object","optional":false,"default":null,"description":"mini-submarine","types":["Object"],"since":null,"text":"object: Object - mini-submarine"}],"returns":{"type":"Boolean","types":["Boolean"],"description":"true if submerged","text":"Boolean - true if submerged"},"form":"unary","operator":null,"left":null,"right":{"text":"object","types":["Object"]}}],"examples":[{"text":"```sqf\nprivate _isUnderwater = underwater vehicle player;\n```","code":["private _isUnderwater = underwater vehicle player;"]},{"text":"```sqf\nprivate _isHeadUnderwater = eyePos player select 2 < 0;\n```","code":["private _isHeadUnderwater = eyePos player select 2 < 0;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["isTouchingGround","isAbleToBreathe"],"notes":[{"user":"Killzone_Kid","date":"2017-02-02T18:08:00Z","text":"This command is quite buggy with objects other than mini-subs. Code in #Example 2 is a good alternative."}],"categories":["Arma 3: New Scripting Commands","Arma 3: Scripting Commands","Command Group: Object Manipulation","Introduced with Arma 3 version 0.50","Scripting Commands"]}