I have a problem with the way my bullet moves. After trying many different options, I finally made a bullet that moves and works the way I want it, with one small caveat: even after shooting it, it follows the mouse's position. I want a bullet that, after being shot, continues in the direction it was originally shot. Here is the code:
var vel = Vector2(0,1000) # Change Y factor to change bullet speed
onready var timer = get_node("Timer")
pos = get_pos()
pos += vel*delta
In the node tree, the bullet is a child of weapon. The weapon's code allows it to lookat() the localmouse_position(), so the bullet will fire towards wherever the mouse is at. My question is how to make the bullet shoot straight rather than change in midair according to where the mouse is?