I started working on aiming in an isometric game yesterday and I did manage to create functions that select a target point based on the cursor position in the active viewport, one using a raycast 3D and one using an intersect_ray() call to a PhysicsDirectSpaceState3D.
To test them I just used a node 3D named Visref2 with a box mesh as it's child and then set the global position of Visref2 to the position that my targeting functions return. When I place the cursor in a location and then call the function the mesh moves to the appropriate location perfectly. HOWEVER If I'm moving the mouse while I press the input to call the function or if I call the targeting functions from inside a _physics_process(): and set the position of Visref2 in _process(): or _physics_process() at the same time, then Visref2 will lag behind the mouse position. The faster I'm moving the mouse the farther it lags and It will catch up to the right spot if I stop moving the mouse.
So it seems to me that there is either a delay between cursor movement and target-point calculation or between the target-point calculation and assigning a position to Visref2 (or both). But I have no clue how to track it down.
Any ideas would be appreciated. I'm pretty new to this, only started using Redot and learning to code about 3 months ago.
Here is a link to some recordings of the issue, one of which is just part of another but slowed down to make it easier so see.
https://drive.google.com/drive/folders/1o97T6Xi_gPgEt4OuGN6WGMZlkGHyJT8Q?usp=sharing