getRelDir: 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> " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|Game|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments( \("local" or "global"\))?|Effects|Multiplayer Effects( \("local" or "global"\))?|Multiplayer Exe...)
Line 1: Line 1:
{{Command|Comments=
{{Command


|arma3|Game name=
|arma3


|1.56|Game version=
|1.56


|arg= global|Multiplayer Arguments=
|arg= global


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


| Returns direction, which is relative to object's current direction, from given object to another object or position in the range from 0 to 360, the equivalent of [[BIS_fnc_relativeDirTo]]. Taking the current [[direction]] of the object into account. |DESCRIPTION=
| Returns direction, which is relative to object's current direction, from given object to another object or position in the range from 0 to 360, the equivalent of [[BIS_fnc_relativeDirTo]]. Taking the current [[direction]] of the object into account.


| object '''getRelDir''' position |SYNTAX=
| object '''getRelDir''' position


|p1= object: [[Object]] |PARAMETER1=
|p1= object: [[Object]]
|p2= position: [[Object]], [[Position2D]] or [[Position3D]] |PARAMETER2=
|p2= position: [[Object]], [[Position2D]] or [[Position3D]]
| [[Number]] |RETURNVALUE=
| [[Number]]
|x1 = <code>_reldir = [[player]] '''getRelDir''' tank;</code> |EXAMPLE1=
|x1 = <code>_reldir = [[player]] '''getRelDir''' tank;</code>
| [[getDir]], [[direction]], [[getDirVisual]] |SEEALSO=
| [[getDir]], [[direction]], [[getDirVisual]]


}}
}}

Revision as of 01:40, 18 January 2021

Hover & click on the images for description

Description

Description:
Returns direction, which is relative to object's current direction, from given object to another object or position in the range from 0 to 360, the equivalent of BIS_fnc_relativeDirTo. Taking the current direction of the object into account.
Groups:
Object Manipulation

Syntax

Syntax:
object getRelDir position
Parameters:
object: Object
position: Object, Position2D or Position3D
Return Value:
Number

Examples

Example 1:
_reldir = player getRelDir tank;

Additional Information

See also:
getDirdirectiongetDirVisual

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

Bottom Section

Posted on August 7, 2018 - 21:50 (UTC)
Tankbuster
To clarify, this returns a relative direction, so objects directly in front are said to be at zero degrees. So, taking example 1 above, if the tank is in front of the player, this function will return 0. If the tank is to the right of the player, it will return 90.