look_at() not looking at

Hello !
I’m new to this engine and I’m having a issue with the look_at() function.
I’m trying to make the player shoot a bullet in direction of the cursor
This is my code for the bullet :

extends Area2D

@export var SPEED := 5000

var movement_vector := Vector2(0,-1)

func _ready():

func _physics_process(delta):
	global_position += (movement_vector.rotated(rotation) * SPEED * delta)

And my code to shoot it (inside player scene) :

	if Input.is_action_just_pressed("shoot"):
		var bullet_instance = bullet.instantiate()

But the bullet is not going where the cursor is
(if you can please help locate the bullet too :slight_smile: )


try change var movement_vector := Vector2(0,-1)
i think RIGHT will be working

1 Like