Profile image

HELP (auto-aim motion limit)

1,171 Star54ilor  2 months ago

for the longest time I've been trying to search for an auto aim code that limits the motion range of both the elevation and heading rotators to the angle of my choice. I don't even need it to aim ahead I just want it to point at the target. that's the only thing holding me back from publishing like 1 or 2 builds

  • Log in to leave a comment
  • Profile image
    93.4k winterro

    @4e8e87 my autoaim has that, if ya wanna use it, any tnk of mine has it.

    It also is orientation proof

    2 months ago
  • Profile image
    7,586 overlord5453

    @Star54ilor to share a link use this
    [alt test](your link)
    Nothing showed up with link you provided

    2 months ago
  • Profile image
    7,586 overlord5453

    @Star54ilor again, you're welcome. If there's anything else, just summon me. I will do what I can.

    2 months ago
  • Profile image
    1,171 Star54ilor

    @overlord5453 didn't work either, I uploaded the vehicle and here's the link: https://www.simpleplanes.com/a/2xNu7Z/Fixer-Mk1-Traverse-Test

    honestly thanks a lot for staying with me on this painstaking task, I really appreciate it

    2 months ago
  • Profile image
    7,586 overlord5453

    @Star54ilor try this:
    clamp((deltaangle(Heading,TargetHeading)/10) * 10, -6.1,6.1)
    Are you trying to limit the rotation to 6 degrees? If this didn't work, upload it as unlisted and tag me there. I will take a look at it and what I can do.

    2 months ago
  • Profile image
    1,171 Star54ilor

    @overlord5453 I appreciate the response! so I've tried bringing in the cockpit closer put it's not doing much unfortunately, it's an issue with the traverse rotator. it could be cause by the way I handled the code or configured the rotator so here are the settings:

    Input code: clamp(deltaangle(Heading,TargetHeading) / 6.1, -6.1, 6.1)
    Range of Motion: 10*
    min=-1
    max=1

    2 months ago
  • Profile image
    7,586 overlord5453

    @Star54ilor you're welcome
    i think it's the cockpit's position that's causing the offset. Remember, all values depends on your cockpit/flight computer position. For example, values like altitude, target distance ,target elevation and heading depends on the cockpit/flight computer. You could solve it by bringing it as close as possible to the Rotators. Keep it at the same x, z position as the traverse rotator and x, y, z position of the elevation rotator for best accuracy.
    You can do a simple experiment to see how it affects the output. First spawn in just the cockpit on the ground and note the altitude and spawn it again but this time place a fuselage pice Or few blocks below it and you will see the altitude is higher compared to the previous.

    2 months ago
  • Profile image
    1,171 Star54ilor

    @overlord5453 IT WORKS. You have my eternal gratitude, thank you so much!!

    although I had just noticed a huge flaw, my aiming tends to be a bit offset now, any way to go around this?

    +1 2 months ago
  • Profile image
    7,586 overlord5453

    Use deltaangle(Heading,TargetHeading) / angle for traverse and TargetElevation / angle for elevation.
    Try clamp(input, minimum limit, maximum limit) for limiting it's movement.

    +1 2 months ago