I'm trying to make AA system for my ship but couldn't figure out how to start doing it, I could ask for permission take parts from other people AA builds but that feels kinda off for me.
So is there anyone who can give me an example of a code? Maybe explain a little bit?
I tried using cam controls at first using rotators but it's wobbly and it is manual, probably better for main turret rather than AA gun
Sooner or later I will update my auto aim.
To create a simple auto-aiming AA system, place a camera on your ship to track the target's position. Use Funky Tree to calculate the difference between the camera's position and the target, then apply rotators to control the AA gun's horizontal and vertical movement. Here's the script you can use:
targetPosition = cameraPosition - targetPosition
,horizontalTarget = targetPosition.x
,verticalTarget = targetPosition.y
,horizontalRotator = rotator(0, horizontalTarget, 1)
,verticalRotator = rotator(0, verticalTarget, 1)
, andaaGunRotator.Horizontal = horizontalRotator
,aaGunRotator.Vertical = verticalRotator
. To smooth out the movement and reduce wobble, usesmoothstep()
, likesmoothHorizontal = smoothstep(horizontalRotator, horizontalRotator, 0.1)
andsmoothVertical = smoothstep(verticalRotator, verticalRotator, 0.1)
. If you want the AA guns to fire only on specific sides (e.g., starboard or port), use activation groups to control which guns are enabled based on the target's location. Adjust the settings and test until the system works as desired.the autoaim itself is standard basic though, but it's activationGroup basically limits it
eee... may I suggest my IJN Yukikaze? it has AA that corresponds to which side the target is(example : target is on the starboard of ship, only fires AA on the starboard part of ship), courtesy of LocalDealer