I’ve not done this kind of math in a long time, and this is proving difficult for me and I feel I’m missing something obvious.
My player controls a ground vehicle, moving across the X and Y axis. Let’s say he’s facing X axis forward, which I believe is vector X: 1, Y: 0 ? If I get actor location, break it into a vector, and subtract 300 from the X axis and place an object there, well hey presto, the object is where I expect it to be! Now, though, my player rotates 90 degrees so that he is traveling along the Y axis. Now my object is to the player’s right and not just behind him, because from this angle 300 needs to be subtracted from the Y axis to place the object behind them.
Am I doing something completely wrong here, or am I just missing something? I’ve been playing with fitting the player vector and/or rotation into the equation, because that feels naturally intuitive, but I can’t figure out how to apply the player vector (or rotation) to the player location to give me a map location in X, Y, Z coordinates that is consistently behind the player regardless of his rotation.
Thanks for your time!