Profile image

Auto-aim Inputs

14.9k Onat67  7 months ago

I used some auto-aiming turrets at my last build and there is some examples for copypaste:

For 45 degree elevation
clamp((TargetElevation + rate(TargetElevation)(((1000 * sin(asin((TargetDistance * 9.81)/(pow(1000, 2)))/2))/9.81) * 2)) + (asin(((TargetDistance + rate(TargetDistance)(((1000 * sin(asin((TargetDistance * 9.81)/(pow(1000, 2)))/2))/9.81) * 2))* 9.81)/(pow(1000, 2)))/2),-10,45)/45

For 180 degree rotation
(TargetHeading - Heading + rate(TargetHeading)*(((1000 * sin(asin((TargetDistance * 9.81)/(pow(1000, 2)))/2))/9.81) * 2))/180

These are not written by me I used mahardika's builds to get them

  • Log in to leave a comment
  • Profile image
    14.9k Onat67

    @Star54ilor go to JointRotator part in XML Editor and set the range part to 180.

    2 months ago
  • Profile image
    1,171 Star54ilor

    just one thing I'm dying to know, how can I set the 180 degree rotation code to set a motion limit of whatever number I please?

    2 months ago
  • Profile image
    14.9k Onat67

    @Eggplant I have seen that them become a nightmare for students at my age (:

    7 months ago
  • Profile image
    59.3k TheMouse

    @Eggplant
    Good for you.

    7 months ago
  • Profile image
    12.5k Eggplant

    i like trigonometry

    7 months ago