I'm trying to make a line face a point. However, I'm not sure how to mathematically do this. I tried googling, but no luck(it seems to think that I want to know how to draw a line, or do it in unity).
I'm not talking about having a line drawn from one point to another, I mean have it FACE the point, and I don't want to use a rotate function either, because I need this for testing collision with something. For instance, a line with a length of 100 pixels, always, and when the player(the second point) is 50px below the first point, and is on the same X position as it, the line will be drawn down, with 50px of line leftover below the player. I've tried using the sin and cos of the slope of the line, but that just spazes out.
Thanks in advance!
How to make a line that faces something
Root / Programming Questions / [.]
VakoreCreated:
Angles vs me. Not a good combination.
Somewhere between the ATan2, the occasional Rad/Deg converting, the confusion of some certain languages flipping the Y co-ords around, and my own second-guessing,, I can NEVER get my angles right on the first try.
Always have to code/test/fix.. every single time!!
Angles vs me. Not a good combination. Somewhere between the ATan2, the occasional Rad/Deg converting, the confusion of some certain languages flipping the Y co-ords around, and my own second-guessing,, I can NEVER get my angles right on the first try. Always have to code/test/fix.. every single time!!Trigonometry: Attack on