isTouchingGround: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
m (Text replacement - "\|s([0-9])\= '''([^' ]+)'''([^ ]+) " to "|s$1= $2$3 ")
(37 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|0.50|= Game version
|version1= 0.50
|arg= global|= Arguments in MP
|arg= global
____________________________________________________________________________________________


| Returns true if object is touching the ground.  |= Description
|gr1= Object Manipulation
____________________________________________________________________________________________


| '''isTouchingGround''' object |= Syntax
|descr= Returns true if object is touching the ground.


|p1= object: [[Object]] |= PARAMETER1
|s1= [[isTouchingGround]] object


| [[Boolean]] |= RETURNVALUE
|p1= object: [[Object]]


|r1= [[Boolean]]


|x1= <code>if ([[isTouchingGround]] [[player]]) then {[[hint]] "Terraferma!";};
|x1= <code>if ([[isTouchingGround]] [[player]]) then {[[hint]] "Terraferma!";};
</code>|= EXAMPLE1
</code>
 
____________________________________________________________________________________________
 
| [[underwater]] |= SEEALSO


| |= MPBEHAVIOUR
|seealso= [[underwater]]
____________________________________________________________________________________________
}}
}}


<h3 style='display:none'>Notes</h3>
<dl class="command_description">
<dl class='command_description'>
<!-- Note Section BEGIN -->
 
<!-- Note Section END -->
</dl>
 
<h3 style='display:none'>Bottom Section</h3>
[[Category:Arma_3:_New_Scripting_Commands_List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]


<!-- CONTINUE Notes -->
<dt></dt>
<dl class="command_description">
<dd class="notedate">Posted on June 1, 2014 - 01:23 (UTC)</dd>
<dd class="notedate">Posted on June 1, 2014 - 01:23 (UTC)</dd>
<dt class="note">'''[[User:AgentRevolution|AgentRevolution]]'''</dt>
<dt class="note">[[User:AgentRevolution|AgentRevolution]]</dt>
<dd class="note">
<dd class="note">
If you are using this command as a validation method, it should not be the sole thing you are checking for, as the result is often inaccurate. For example, it returns false for some helicopters when landed on the roof of certain buildings, and it always returns false for boats, even if they are beached.
If you are using this command as a validation method, it should not be the sole thing you are checking for, as the result is often inaccurate. For example, it returns false for some helicopters when landed on the roof of certain buildings, and it always returns false for boats, even if they are beached.
</dd>
</dd>
</dl>
<!-- DISCONTINUE Notes -->


<!-- CONTINUE Notes -->
<dt><dt>
<dl class="command_description">
<dd class="notedate">Posted on September 29, 2016 - 08:28 (UTC)</dd>
<dd class="notedate">Posted on September 29, 2016 - 08:28 (UTC)</dd>
<dt class="note">[[User:Demellion|Demellion]]</dt>
<dt class="note">[[User:Demellion|Demellion]]</dt>
Line 61: Line 40:
</code>
</code>
</dd>
</dd>
</dl>
<!-- DISCONTINUE Notes -->


<!-- CONTINUE Notes -->
<dt><dt>
<dl class="command_description">
<dd class="notedate">Posted on November 10, 2016 - 20:57 (UTC)</dd>
<dd class="notedate">Posted on November 10, 2016 - 20:57 (UTC)</dd>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
<dt class="note">[[User:Pierre MGI|Pierre MGI]]</dt>
<dd class="note">
<dd class="note">
This command returns always true if the object is attached to some other object with the command attachTo, like for vehicle air drop with parachute.
This command returns always true if the falling object is attached to some other object with the command attachTo, like for vehicle air drop with parachute.
</dd>
 
<dt><dt>
<dd class="notedate">Posted on April 26, 2017 - 20:02 (UTC)</dd>
<dt class="note">[[User:Gippo|Gippo]]</dt>
<dd class="note">
Be aware: it is not reliable on remote objects.
</dd>
</dd>
</dl>
</dl>
<!-- DISCONTINUE Notes -->

Revision as of 18:04, 20 June 2021

Hover & click on the images for description

Description

Description:
Returns true if object is touching the ground.
Groups:
Object Manipulation

Syntax

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

Examples

Example 1:
if (isTouchingGround player) then {hint "Terraferma!";};

Additional Information

See also:
underwater

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 June 1, 2014 - 01:23 (UTC)
AgentRevolution
If you are using this command as a validation method, it should not be the sole thing you are checking for, as the result is often inaccurate. For example, it returns false for some helicopters when landed on the roof of certain buildings, and it always returns false for boats, even if they are beached.
Posted on September 29, 2016 - 08:28 (UTC)
Demellion
In addition to previous statement: That behaviour is true, simply because isTouchingGround applied to a player unit (or any unit) is frozen to a last state when unit enters vehicle. To get proper return from this command you should go for units vehicle: _var = isTouchingGround player // Unreliable _var = isTouchingGround (vehicle player) // Pretty reliable
Posted on November 10, 2016 - 20:57 (UTC)
Pierre MGI
This command returns always true if the falling object is attached to some other object with the command attachTo, like for vehicle air drop with parachute.
Posted on April 26, 2017 - 20:02 (UTC)
Gippo
Be aware: it is not reliable on remote objects.