Jump to content
Sign in to follow this  
charon productions

Staticweapon gunner absolute position ?

Recommended Posts

Trying to get a reference to the gunner of a static weapon turns out to be complicated.

getposASL on the gunner delivers a wrong position.

Using selectionpos only returns selection positions before the model was animated.

So if an M2 gunner turns the position is not accurate anymore.

That would all be no problem if the gun or turret axis parameter could be accessed.

In cfgvehicle/Mainturret of the Staticweapons there seems to be no config entries concerning the axises.

Finding config axis selection values would really do the trick, but how?

Boundingboxcenter does also not help because, the m2model was placed very much

off-center of the model.

Eyepos and aimpos do also not work for gunners. [0,0,0] is returned.

That would be the easiest solution.

Anyone has an idea on how to get the absolute position of a static weapon gunner?

Edited by Charon Productions

Share this post


Link to post
Share on other sites

Ok, found a solution.

Basically you need to determine the axis position coordinates with a combination of 2 selections ("HitBody" >> "name" and "memoryPointGunnerOptics").

From there it's simple trigonometric math.

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  

×