Jump to content
Sign in to follow this  
zapat

Exact direction of player

Recommended Posts

I would like to make a triangulation script. I need the EXACT direction of where the player is pointing.

Problem is, that aiming has a turning-deadzone: player doesn't immediately turns when mouse is moved: first the gun is moving and after some gun movement the body starts to follow.

getDir player doesn't return the direction of the aiming device (that is where the player is pointing), but returns the center of the deadzone.

So how can I get the exact direction?

Share this post


Link to post
Share on other sites

You could try this, not tested though.

_wPos = screenToWorld [0.5,0.5];


_weaponDir = [player, _wPos] call BIS_fnc_dirTo;

Share this post


Link to post
Share on other sites

Riouken: screencenter is static. That is what direction player returns.

Deadfast: lol, I've never seen this. Thanks.

Umm. How do I get the degrees direction from the vector? My math skills in the holidays converging to zero...

Edited by zapat

Share this post


Link to post
Share on other sites

Lol thanks Deadfast, I have never noticed that command before.

---------- Post added at 02:55 PM ---------- Previous post was at 02:52 PM ----------

Riouken: screencenter is static. That is what direction player returns.

Deadfast: lol, I've never seen this. Thanks.

There is a command, for what you need so that point is moot.

But screenToWorld gives you the pos of what you see on your screen. And in my example above that is exactly where your mouse is pointing. So its not static. It will change when ever you look at something else.

Share this post


Link to post
Share on other sites

You could also turn aiming deadzone off and see if that helps, because, who needs aiming deadzone?

Share this post


Link to post
Share on other sites
You could also turn aiming deadzone off and see if that helps, because, who needs aiming deadzone?

Me!!! I always have a little deadzone!! maybe it stems from ofp :p

Share this post


Link to post
Share on other sites
Umm. How do I get the degrees direction from the vector? My math skills in the holidays converging to zero...

Check the notes ;)

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  

×