underwater: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (template:command argument fix)
(mystery revealed, it a mini sub command)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Return whether object is fully underwater. From Arma 3 v1.66, this also works for units. |DESCRIPTION=
| 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=
____________________________________________________________________________________________
____________________________________________________________________________________________


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


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


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




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


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

Revision as of 01:40, 9 August 2019

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:
Uncategorised

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

Notes

Bottom Section

Posted on February 2, 2017 - 18:08 (UTC)
Killzone Kid
This is still quite buggy and not always reliable. Code in Example 2 is a good alternative.