How is this problem usually solved in 3d space when there is no defined target with a third person camera following a player?
The cameras line of sight looking at an object is different than the line of site from the player.
If you aim at a specific target through the camera, I can send a projectile from the 3rd person player to that point and everything is good. (creating a triangle with 2 separate lines of sight)
However if I am looking past the target at nothing, I have no concrete target point. So the trajectory of a missile fired from the player is dependent on the arbitrary distance I set from the cameras line of site.
Looking at this illustration. The cameras line of site (red line) intersects a target, the player fires towards that target, all is good.
If the camera is looking at the blue line direction. I must choose a distance on the blue line to fire towards. One solution I came up with is to collect objects and assume what the player might be pointing near, to create the point, but that’s not fool proof.
In the real world scenario what happens is I can shoot an object, but if I’m pointing at a close miss, the projectile seems to be wildly missed instead of skimming next to the target, because I may or may not have a similar distance set. Hope that makes sense.
edit: sorry not exactly scripting, feel free to move the post