underwater: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(seems to have been fixed for units)
(behaviour is different in 1.66, note removed)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Return whether object is fully underwater.  
| Return whether object is fully underwater. From Arma 3 v1.66, this also works for units. |= Description
 
'''NOTE''': up to some time before 1.66, this only worked on objects, not units. For units it returned "isSwimming" and not "underwater"  |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 19: Line 17:




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


|x2= <code>_isUnderwater = [[eyePos]] [[player]] [[select]] 2 < 0;</code>|= EXAMPLE2  
|x2= <code>_isUnderwater = [[eyePos]] [[player]] [[select]] 2 < 0;</code>|= EXAMPLE2  
Line 41: Line 39:
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
<!-- CONTINUE Notes -->
<dl class="command_description">
<dd class="notedate">Posted on September 21, 2014 - 20:49 (UTC)</dd>
<dt class="note">[[User:Killzone Kid|Killzone Kid]]</dt>
<dd class="note">
This command name is MISLEADING. It returns true when player is in swimming position and false otherwise. Player can be standing fully underwater and this command would return false or swimming with head above water and this command would return true.<br><br>
</dd>
</dl>
<!-- DISCONTINUE Notes -->


<!-- CONTINUE Notes -->
<!-- CONTINUE Notes -->

Revision as of 13:40, 17 December 2016

Hover & click on the images for description

Description

Description:
Return whether object is fully underwater. From Arma 3 v1.66, this also works for units.
Groups:
Uncategorised

Syntax

Syntax:
underwater object
Parameters:
object: Object
Return Value:
Boolean

Examples

Example 1:
_isUnderwater = underwater 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 December 17, 2016 - 11:08 (UTC)
Fusselwurm
Seems to be fixed for players now (as of 1.66) : returns true if submerged, false is swimming on surface