I am now creating an omni-directional shooter
I would like to implement a homing laser to hit the enemy, but due to the player's rotation, the laser does not fly in the intended direction because it is out of alignment with the original position of the enemy.
I tried to find a method in Vector2 that would give a good result, but it did not work.
Is there any good way or formula to do this?
Or is there a formula for this?
var h = load("res://Graphics/Bom/Horming.tscn")
var h_instance = h.instance()
var speed = 1000
var angle = -90 + rand_range(-45, 45)
while len(enemy_list) > 0:
var enemy = enemy_list.pop_front()
var enemy_direction = Vector2(cos(self.rotation_degrees), sin(self.rotation_degrees))
for j in range(0, 32):
h_instance.start(speed, angle, Vector2.ZERO, enemy.position.rotated())