underwater: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<h3 style='display:none'>Notes</h3> <dl class='command_description'> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> <h3 style='display:none'>Bottom Section</h3>" to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame( +[0-9])?|Game [Vv]ersion( +[0-9])?|Game Version \(number surrounded by NO SPACES\)|Arguments in MP|MP[Aa]rg|Multiplayer Arguments( \("local" or "global"\))?|Effects|Execution|Effects...)
Line 1: Line 1:
{{Command|Comments=
{{Command


| arma3 |Game name=
| arma3


|0.50|Game version=
|0.50


|gr1= Object Manipulation |GROUP1=
|gr1= Object Manipulation


| Returns whether the object is fully underwater<br><br>
| Returns whether the object is fully underwater<br><br>
{{Informative | This command works well with Arma 3 mini-submarines, which was the primary design goal most likely}} |DESCRIPTION=
{{Informative | This command works well with Arma 3 mini-submarines, which was the primary design goal most likely}}


| '''underwater''' object |SYNTAX=
| '''underwater''' object


|p1= object: [[Object]] - mini-submarine |PARAMETER1=
|p1= object: [[Object]] - mini-submarine


| [[Boolean]] - [[true]] if submerged |RETURNVALUE=
| [[Boolean]] - [[true]] if submerged




|x1= <code>_isUnderwater = [[underwater]] [[vehicle]] [[player]];</code>|EXAMPLE1=
|x1= <code>_isUnderwater = [[underwater]] [[vehicle]] [[player]];</code>


|x2= <code>_isUnderwater = [[eyePos]] [[player]] [[select]] 2 < 0;</code>|EXAMPLE2=
|x2= <code>_isUnderwater = [[eyePos]] [[player]] [[select]] 2 < 0;</code>


| [[isTouchingGround]], [[isAbleToBreathe]] |SEEALSO=
| [[isTouchingGround]], [[isAbleToBreathe]]


| |MPBEHAVIOUR=
|
}}
}}



Revision as of 12:25, 18 January 2021

Hover & click on the images for description

Description

Description:
Returns whether the object is fully underwater

This command works well with Arma 3 mini-submarines, which was the primary design goal most likely
Groups:
Object Manipulation

Syntax

Syntax:
underwater object
Parameters:
object: Object - mini-submarine
Return Value:
Boolean - true if submerged

Examples

Example 1:
_isUnderwater = underwater vehicle player;
Example 2:
_isUnderwater = eyePos player select 2 < 0;

Additional Information

See also:
isTouchingGroundisAbleToBreathe

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
Posted on February 2, 2017 - 18:08 (UTC)
Killzone Kid
This command is quite buggy with objects other than mini-subs. Code in Example 2 is a good alternative.