Hello!
I am using Godot 4.2.2.
I am trying to replicate the Character movement from games like Arcanorum (Online Flash game) or Hammerfight (Steam). The movement is aiming to imply a flying machine that follows the mouse cursor.
Because the character is supposed to "Ragdoll" after being struck (Rotate around it's own axis as it's flung by the force of the blow), and its means of attack is a physics action of winding up what's effectively a weight on a chain attached to your character, to smack other characters with it by pulling at the weight with your ship and making it spin around it, I've assumed a RigidBody2D would be the most effective choice.
I've managed to make the created body follow the mouse, as well as apply a "righting" torque to make the 'flying machine', or character, right itself, for me to disable when the character is going to be ragdolling (Whenever I work on that).
I've come across a problem, however, as now, the Character Orbits around the mouse, rather than closely following it. And With just barely enough force being applied, to reduce the potential for Orbiting, it not only still happens, but when it's 'on mouse', it bobs up and down anyhow. I can't come up with an obvious solution to do this.
I've thought about making the "Speed" or Force i apply to the ship be variable based on the distance from the mouse, But as it's a physics object, I believe i'd need to apply an opposite Force to slow down the character as it approaches within a certain distance of the Destination/mouse? (As i'll probably want to use the same code for both npc and player character movement, with AI defining points/paths for themselves to follow over time, while the player has their mouse to do the same)
All this is quite complicated for my brain, and i'd appreciate advice on subjects to research or concepts i should look into for solving this issue myself. I won't say no to more direct explanations, either.