Profile image

Need Funky Tree help on auto aiming turrets

2,995 Pnut  20 days ago

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

  • Log in to leave a comment
  • Profile image
    54.6k SILVERPANZER

    Sooner or later I will update my auto aim.

    19 days ago
  • Profile image
    1,277 Khichi2866

    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), and aaGunRotator.Horizontal = horizontalRotator, aaGunRotator.Vertical = verticalRotator. To smooth out the movement and reduce wobble, use smoothstep(), like smoothHorizontal = smoothstep(horizontalRotator, horizontalRotator, 0.1) and smoothVertical = 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.

    +1 20 days ago
  • Profile image
    73.9k Monarchii

    the autoaim itself is standard basic though, but it's activationGroup basically limits it

    20 days ago
  • Profile image
    73.9k Monarchii

    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

    20 days ago