Ray not going to correct position
Questions that may already have your answer: So in my game, I have a grappling hook as the main mode of transport, for this grappling hook to work I need to draw a ray from my player to where my mouse is. I have this working correctly, for the most part, it finds my mouse position and draws a ray there, however the ray doesn't go to the mouse (See Pic Below).
The green line is where it should be going but the red line is where it is. These are different because the red one is a DrawRay and the green is a DrawLine.
Does anyone know how to get the ray going to the draw line point?
Answer by $$anonymous$$ · May 29, 2018 at 08:19 AM
I managed to fix this myself, it was a bit inconvenient but it worked. I created an object to follow the player's mouse and made it always look at the player. For the raycast I just used the -transform.forward as the direction and it works like a charm.