When tapping quickly many times on the TLAnalogJoystickHiddenArea node and progressively moving your touches outside of its frame, I noticed that it can capture touches outside of its frame which can place the TLAnalogJoystick outside of the hidden area.
I wasn't able to isolate the root cause of this, but here's a suggested solution, modifying TLAnalogJoystickHiddenArea's touchesBegan method to sanity check touchLocation before proceeding further. This fixed the issue on my end.
class TLAnalogJoystickHiddenArea: SKShapeNode {
...
open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
guard let currJoystick = self.currJoystick else {
return
}
let firstTouch = touches.first!
let touchLocation = firstTouch.location(in: self.scene!)
guard let path = self.path, path.contains(touchLocation) else {
return
}
currJoystick.position = touchLocation
currJoystick.isHidden = false
currJoystick.touchesBegan(touches, with: event)
}
...
}