Look_At not working with object instances

Godot Version

4.3

Hey guys, I’m making an enemy that shoots projectiles at the player.
The projectile targeting is simple,

func _ready():
	var look = target.global_position
	look_at(look)

This works normally, but when instanced they use the origin as a base point.

Do you mean that they don’t find the target and fly to the wrong place,
or that they appear in the wrong place when instanced?

They appear in the correct position but they fly to the wrong place

How do you set the target? Maybe there’s something wrong there. Any warnings in the console? You could try printing the name of the target:

func _ready():
	var look = target.global_position
	look_at(look)

	print(target.name)

I set the target using
@onready var target = $"../Player1"

Could this be the same problem: Help with look_at() function - #5 by Fryker

If that’s it, you can just rotate after look_at:

func _ready():
	var look = target.global_position
	look_at(look) # x-axis is pointing at target
	rotate(PI/2) # Now y-axis is pointing at target