Hello,
I have successfully made this eye shoot bullets, but they are slight offset, ChatGDP summarized the issue pretty well.
The slight offset you're experiencing might be due to the difference between the gun's rotation and the direction of the mouse cursor. When you set the rotation of the bullet instance to match the gun's rotation, it doesn't necessarily mean the bullet will move in the same direction as the mouse cursor.
Sadly, most of the help it gives is Godot 3.X and not fully up to date.
Here is the code from the player :
if Input.is_action_just_pressed("fire"):
shoot()
func shoot():
var mousepos = get_viewport().get_mouse_position()
var bullet_instance = bullet.instantiate()
gun.look_at(mousepos)
owner.add_child(bullet_instance)
bullet_instance.global_position = gun.global_position
bullet_instance.global_rotation = gun.global_rotation```
BULLET CODE :
```extends Area2D
var speed = 150
var direction = 0
# Called when the node enters the scene tree for the first time.
func _physics_process(delta):
position += Vector2.from_angle(direction) * speed * delta
S```
Find attached, a GIF of the issue.
Thanks !


