How should I have bullets shoot at mouse.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By disoriental
:warning: Old Version Published before Godot 3 was released.

I have a top down shooter that currently just shoots at the arrow key directions and I want to turn that into shooting at where the mouse is located. I was thinking about getting the mouse’s global position Vector2 and set the linear_velocity of those bullets(RigidBody2d) to that vector. What are some other approaches? How would I do this using Raycast2d? And how would I lock my mouse within my game window?