hi
yes, trying to do a dual stick control with and aim that is kept in a circle, the left stick is easy, but below is the right stick code to get a smoother facing angle and maintain the direction. the below works quite well but as the lookaxis is moving left it minuses from lookaxis.x and then when i go right it takes a long time to get there due to needing to add until it get right, the same problem with left and right.
i did look at getting the angle from the stick but it's quite jittery, i need it to stay... or maybe I'm over thinking and there is an better solution.
var lookaxis = Vector2()
var deadzone = 0.25
lookaxis.x = float(Input.get_action_strength("look_right")) - float(Input.get_action_strength("look_left"))
lookaxis.y = float(Input.get_action_strength("look_down")) - float(Input.get_action_strength("look_up"))
if abs(lookaxis.x) > deadzone || abs(lookaxis.y) > deadzone:
dir = lookaxis
var pospos = $Aim.position + lok_axis.normalized() * 20
aimangle = ($Aim.global_position - global_position).angle()
var dist_from_centre = (pospos - position).length()
#keeps the aiming pos in a circle
if dist_from_centre > 300:
$Aim.position = (pospos.normalized() * 300) * 1 #change 1 to higher for a quicker turn