Making projectiles to always go in a straight line towards a moving target

Godot Version




Is there any way to make the projectiles to always go straight towards the crosshair?

With this code, the projectiles always lagging behind the moving crosshair. (probably by .1 second)
There’s some other method that I tried, but that one causes the projectiles to curve towards the crosshair instead.
I attached the scene tree in case it’s a parenting problem.

func SpawnProjectile():
	var bulletTween = create_tween()
	var bullet = projectile.instantiate()
	bullet.global_position = weaponLocation.global_position
	bulletTween.tween_property(bullet, "position", crosshair.position, .1)

You should tween global positions, and not local position. This could cause some issues.