Hi there,
I'm creating a multiplayer game using godot4 beta 10, and I have some hitscan weapons, if we take the sniper rifle for example, whenever a player takes a shot I'd like to get the point at which this hitscan ray intersects something, if it's not intersecting, then I'd just like to get the endpoint.
If intersecting, then ray.get_intersection_point() works well, as it retruns the place that was hit in global coordinates, when the ray is not intersecting, this method doesn't return the endpoint, but I believe just the closest point on any node to the ray.
In the case where the ray is not intersecting I found that we have target_position available to us, which looks similar to cast_to in previous versions of godot. The thing is that target_position is always a relative and thus un-rotated vector3.
Note that my goal is to get the endpoint of the raycast in global coordinates.
From here was able to get the global_rotation of the view of the player (where the ray eminates from), but I'm unable to apply this rotation as it's in euler angles and there is no method in Vector3 which allows for rotation in this format.
I was hoping that I could get some help with this.
Thanks,
cuppajoeman