So I’m having a bit of an issue getting my rocket launcher weapon to properly rotate towards the crosshair. Basically I have it setup so that there’s a linecast from the camera position, through the crosshair into the world. From there I determine the RotateTowards rotator between the end point of the rocket launcher (the socket called “Projectile”) and the HitPoint of the line cast. However whenever my vehicle is at an agressive angle or upside down, the rocket launcher and gimbal fling every where.
http://imgur.com/a/BW5ys ← all relevant pictures.
The setup is that there’s a rocket launcher barrel that can only elevate, and a gimbal that can only rotate horizontally (yaw). Any ideas? Or if there’s a better way I should be setting this up. I notice I’ll have issue when look up into the air and don’t get a hit location. Not too sure how to handle that condition yet either. Any help would be greately appreciated.