#store coordinates
execute store result score .x_player gunner run data get entity @s Pos[0] 10000
execute store result score .y_player gunner run data get entity @s Pos[1] 10000
execute store result score .z_player gunner run data get entity @s Pos[2] 10000

execute as @e[type=marker,tag=gunner_marker] at @s run teleport @s ^ ^ ^3

#determine the coordinates of the new pos
execute store result score .x_hook gunner run data get entity @n[type=marker,tag=gunner_marker] Pos[0] 10000
execute store result score .z_hook gunner run data get entity @n[type=marker,tag=gunner_marker] Pos[2] 10000
execute store result score .y_hook gunner run data get entity @n[type=marker,tag=gunner_marker] Pos[1] 10000

#determine the vector
scoreboard players operation .x_hook gunner -= .x_player gunner
scoreboard players operation .y_hook gunner -= .y_player gunner
scoreboard players operation .z_hook gunner -= .z_player gunner

#store
execute store result storage gunner coordinates.x int 0.2 run scoreboard players get .x_hook gunner
execute store result storage gunner coordinates.y int 0.2 run scoreboard players get .y_hook gunner
execute store result storage gunner coordinates.z int 0.2 run scoreboard players get .z_hook gunner

execute store result storage gunner coordinates.pulse.x int 0.5 run scoreboard players get .x_hook gunner
execute store result storage gunner coordinates.pulse.y int 0.5 run scoreboard players get .y_hook gunner
execute store result storage gunner coordinates.pulse.z int 0.5 run scoreboard players get .z_hook gunner

execute at @s as @e[type=marker,tag=gunner_marker] run teleport @s ~ ~ ~