OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: johnnyboy on 11 Aug 2008, 21:51:38

Title: detect direction unit is aiming versus direction unit is facing
Post by: johnnyboy on 11 Aug 2008, 21:51:38
Greetings.

When a player is facing one direction, he can adjust his aim left/right 10 or 20 degrees before his body changes direction.

GETDIR tells us the direction the unit's body is facing.  Is there a way to detect the exact direction the unit is aiming?

Maybe by detecting the direction of the "internal view" camera of a unit?

Please advise.
Title: Re: detect direction unit is aiming versus direction unit is facing
Post by: CrazyAce on 11 Aug 2008, 22:00:45
This for AI or human? I thought that AI doesn't have floating camera.
Title: Re: detect direction unit is aiming versus direction unit is facing
Post by: Wolfrug on 11 Aug 2008, 23:30:10
You can use the weaponDirection (http://www.ofpec.com/COMREF/index.php?action=list&game=All&letter=w#816) command to find out where the gun is pointing (float zone and all), however it can't be used when the unit isn't sporting a weapon (i.e., unarmed). Alternatively, this (http://www.ofpec.com/forum/index.php?topic=31686.0) little function by Spooner might be the very thing you're looking for  :cool2:

Good luck!

Wolfrug out.
Title: Re: detect direction unit is aiming versus direction unit is facing
Post by: johnnyboy on 12 Aug 2008, 06:38:15
weaponDirection works perfect. Thanks a million Wolf!

I guess this wasn't such an advanced question after all...since a command exists for it... :-[
Title: Re: detect direction unit is aiming versus direction unit is facing
Post by: h- on 12 Aug 2008, 09:14:25
Quote
I guess this wasn't such an advanced question after all
:whistle:

Moved.