Jump to content
Sign in to follow this  
dr_eyeball

Get freelook head direction

Recommended Posts

Q: How can you get the direction your head is facing when using freelook to look around? (which is not player direction)

It relates to displaying things on a HMD HUD.

UNN has this great 'turret direction' topic using AnimationPhase, which I suspect would also work for the player's head if I knew the head's freelook animation name (if one exists). If anyone can advise either way here too.

Share this post


Link to post
Share on other sites

I did this little test way back, it might set you on the right path if you're good at maths.

name a unit s1

init.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">ij =0;

while{alive s1}do

{

sleep .5;

ij = ij + 1;

 wpos = positionCameraToWorld getpos s1;

 hint format["%1",wpos];

};

Share this post


Link to post
Share on other sites

Beauty. Nice solution - pure numbers, no strings. That should work well. Thanks for that info.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×