Quantcast
Channel: Programming (In-game)
Viewing all articles
Browse latest Browse all 645

Getting a Vector3D in front of a Raycast Target

$
0
0
I am trying to finish up an autopilot script that flys to the currently detected target using a camera raycast.

The difficult part I'm finding is how to get a position that is on the same vector as the hit position, but X meters in front of it. I've been trying to use the DetailedInfo position and compare it to the HitPosition value to try to figure out the vector line, but I'm terrible with vectors and not sure the best way to go about it.

Any help is much appreciated.

Viewing all articles
Browse latest Browse all 645

Trending Articles