Hey! i've wanted to make an autoleading air to air turret for multiple uses. "ball" turret is the main reason but the new, creative, silly and inventive reason is to use the laser from, umm, simpleplanes plus..? -and use it to attach a laser that autoleads to show when i should shoot with standard SP velocity bullets and another laser directly pointing at the target. I can make the turret, i just need the Funky Trees code because i have absofruitloopy no idea what to do. Imma tag a couple of people who have done autoleading turrets so please don't dismiss this as a spam ping. Thanks!
@SimpleStudent try having the horizontal turret degree range to 180, then set the turrets values to -2 and 2 and have it funkied to TargetHeading/360, I suspect the turret tries to do a complete 180 before then aiming at the target, this might help.
I haven't ignored your post but the topic is extremely complicated to explain so I've been working on it for a good while to have it in layman terms for you.
But, what you can do for the direct aim aspect is to have the rotator that controls the turret elevation (up and down) funkied with TargetElevation/90, where 90 is the degree range of the rotator, you can set it to any degree you want as long as the rotator degree range also matches.
And for the rotator that controls the horizontal movement of the turret, TargetHeading/90 should suffice.
Importantly; You want the entire turret assembly to be attached to a rotator pointing straight froward, that's funkied to RollAngle/360, since the turret can only aim if it's perfectly upright, this would keep it upright regardless of how many times you roll so it can properly keep on target, the maximum rotation range for the small rotator is 180 so make sure to go into the input settings and set the -1 and 1 to -2 and 2.
There's a lot more to it but I hope that helps so far.
If any of the rotators are spinning the wrong way, just add a - sign in front of the 90 or the 360 to the rotator that's faulty.
@JessaLeih there are still problems but there is progress.
I've got a mechanism that always counteracts the roll and pitch albeit these are seperate to the other acting parts
I've got absofruitlooply no idea why the horizontal input won't work. I'll tell you the settings that are notable:
Range of Motion: 180 degrees
Speed: 100%
Input: TargetHeading/360
(Overload) InputController tab:
min = -1
max = 1
I've tried setting the min and max to -2 and 2 but no luck, and all collisions are off.
Could the slight height (0.175 unit difference) have an impact on horizontal rotation, or could it be the fact that it is stacked from top to bottom like so:
Pitch Auto Aim controller
Horizontal Auto Aim controller
Roll Counteracter
Pitch Counteractor
Edit!!!
I may or may not have yoinked some funky trees for horizontal movement BUT here's the code & credit:
TargetSelected ? deltaangle(TargetHeading,Heading)/180 : 0
https://www.simpleplanes.com/a/aByUDq/Auto-Stabilized-Target-Tracking-Camera
Credit to nafeij
@JessaLeih Completely figured out the vertical movement! buuuuut, the horizontal movement is always off at least around 30 degrees. i'm testing this on the Armored Games map with unmoving targets and also testing the tanker as a target
@JessaLeih thanks for the major help! i'll put this into action and tell you if it worked. i cant post due to school internet restrictions
edit: got pitch to work
@JessaLeih @232287168147825 (note: i did not spell this, controlus of c-us and v-us did that)