Jump to content
Sign in to follow this  
Crazy Gentleman

AttachTo rotate with turret

Recommended Posts

Okay, so I currently made a sort of "armor kit" from the A2 Sample Models Humvee GPK for the RHS Humvees so I can add those via AttachTo. I'm currently facing 2 problems:

1. The turret is rotating with the gun, but the center of rotation for the armor kit is not right and probably at an offset. Is there any way I can chance the center of rotation?

2. Even though the armor kit rotates with the gun, the armor kit still rotates with the entire vehicle when steering while driving. Is there a way to remedy this?

 

I hope somebody might be able to help me out.

 

Kind regards,

 

Crazy_Gentleman

Share this post


Link to post
Share on other sites

Hi there,

 

I've tinkered with the solution for problem no.2 before. The best solution that I could come up with is using cba_fnc_addperframehandler; cba_fnc_turretdir; and setDir. For these, you will need to have the CBA mod loaded.

 

Basically what you want to have is a handler that runs every frame, which is the "cba_fnc_addperframehandler". Inside this handler, put in the function "setDir" that takes direction parameter from the function "cba_fnc_turretdir" which returns the value of the turret direction of the vehicle in question.

 

Unfortunately I'm outside right now so I can't give you the code, Imma post it later when I'm home.

 

For problem no.1, you can adjust the model's rotation center by modifying the model's center mass position in object builder, you can do this by adding an arbitrary memory point far behind the actual model to extend the model full size, thus shifting the model's rotation center backward.

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  

×