Newly instantiated arrow follows my Mouse

Godot Version

v4.2.1.stable.official [b09f793f5]


Hello !
I’m trying to understand why my newly created arrow/bullet follows my Mouse instead of the direction I gave in the beginning.

I have a shootingPoint that allways “look_at” my mouse position.
From this position I create an arrow that gets the position and rotation from my shootingPoint.

When I dont move my mouse while the arrow flies it all looks good, but if I move my mouse the direction of the arrow changes. That is not what I want.

Here is my Code:
Bow Script:

extends Area2D

func _ready():

func _physics_process(_delta):

func shoot():
	const ARROW = preload("res://Projectiles/arrow.tscn")
	var new_arrow = ARROW.instantiate()
	new_arrow.global_position = %ShootingPoint.global_position
	new_arrow.global_rotation = %ShootingPoint.global_rotation

func _on_player_pressed_shoot():

Arrow Script:

extends Area2D

var travelled_distance = 0
const SPEED = 200
const RANGE = 200

func _physics_process(delta):
	var direction = Vector2.RIGHT.rotated(rotation)
	position += direction * SPEED * delta
	travelled_distance += SPEED * delta
	if travelled_distance > RANGE:

Recording 2024-03-20 at 11.55.22

Your arrow is a child of $ShootingPoint, still parented to your character as it flies. You gotta add it somewhere else in the hierarchy.

1 Like

Thanks for the quick reply.
Any Idea where I can add it without it interacting with anything else? Is there a best practice?

You can make a custom BulletManager as an independent parent node for all bullets/arrows in your scene. That manager can then also deal with cleanup and hit processing. The manager can still be a child of your level node, so all bullets will get deleted on level swap.

1 Like