With so little information on what you actually want, it’s very difficult to help.
What’s wrong with using look_at and the mouse position? Do you have an example of what you’re trying to achieve?
your orbiting node is in a 3d space, but mouse cursor is in 2d space. You can easily calculate an orbiting position but you must have to project your mouse cursor position to 3d space to “lookat” it.
may be you want the orbiting object to look at the object where the mouse is pointing at?
It’s a top-down Rouge-like. And the node orbiting is the weapon.
I want the node (weapon) to orbit around the player and would change where it’s orbiting around the player depending on the direction the mouse is from the player
From my understanding you want the sword to be a certain distance away from the player, and when the mouse moves, you would like to to move around in a circle around the player.
look_atcan achieve this, but it is better for 3D games as it applies the rotation as well. The maths involved in 2D is trivial.
For the weapon, you can do the following.
get the normalised vector of the mouse away from the node the sword is attached to
If you want to improve the ‘feel’, look into interpolating the positions using e.g. slerp or lerp. This would add a bit of a delay to the movement but it could give some nice weight to the sword.