Hello! Im a beginner here, and trying to make a stellaris-like rts as my first game. Making spaceships a kinematic body didn't quite satisfy me (bcuz acceleration and decelration have to be handled manually, and even then arent perfect), so I want to learn to use rigid bodies. So far I`ve been trying to get it to move to the cursor, and left its rotation (and turning) for later:
func move(delta):
if Input.is_action_pressed("follow"):
target = get_global_mouse_position()
velocity = position.direction_to(target) * speed
apply_central_impulse(velocity * delta)
But it doesn't work too well, either. The ship (from a standstill) doesn't move straight to the target (though it accelerates smoothly, at least), but takes sort of a curved path, and then orbits around the target, oscillating back and forth. I also want it to decelerate before it arrives at the target, so that it wouldn't overshoot, and I would usually try to do that by inverting velocity or applying negative impulse, but seeing how curved the path is... As well as that, I want it to make smooth turns, but when I tried applying torque impulse, it turned into quite a mess, so I chose to ask for help instead. Any help appreciated :)