So, I have a barrel attached to a tank that I want to clamp its axis using the mouse wheel. So it doesn’t go too high up or low down into the tank and a variable to adjust the speed in which the barrel can move. I have it set with a flip flop bool for the middle mouse button to trigger the mouse wheel use. Form there I multiply the wheel axis value with the barrel speed variable, which links into a float clamp. min and max degrees. that goes into a add local actor rotation of the barrel. The barrel moves, but full 360 degrees in either direction. I’ve played with other clamp axis, angle and vector nodes, but I think I’m not connecting them, with the right math to so positive results. I tried a method from a video setting the degrees in a function and calling them once the middle mouse bottom is triggered, but it did not work also. I appreciate any advice.
Try this to clamp when adding:
Should give you same result as this:
Hope it helps.
Unfortunately it did not work. I followed your suggestion, but the problem is once the middle mouse button is pressed the tank barrel immediately rotates to the set clamp axis. Then moving the mouse wheel does move the barrel between the two clamped axis. So I played with widening and shortening the axis. which either keeps the barrel near the default axis (super great) and or barrel rotates into the tank(not so great).
But now I realize through your suggestion I’ve been going about it all wrong. Forgive me I’m learning as I’m going. The overall idea was to have the barrel move or point where the player is aiming with the mouse. Then use the mouse wheel for small adjustments. And clamped because, well the tank barrel cant aim into itself or bend backwards.
So now the issue is still clamping axis rotation? My barrel and turret move where the mouse is pointing, except when the mouse is over(pointing) at the sky or behind the tank, the turret jumps to face the camera. Is this a clamp issue or something to do with “find look at rotation”? I think Ill start a new question page. Its starting to feel like this is a different issue than what I originally sought help for. Thank you. You got me one step closer pointing me in the right direction.