I'm trying to shoot a ray from the 2ktdcamera to see if the mouse it colliding with my sprite. It doesn't work correctly so I'm drawing the line in yellow. It appears offset from the screen a bunch. Notice how high up the yellow line is in the scene view.
Here's my relevant code:
public Camera gameCamera; // 2dtk camera set from editor
ray = gameCamera.ScreenPointToRay(touchPosition);
if (collider.Raycast(ray, out(hit), 10000.0f)){
overObject = true;
}
else{
overObject = false;
}
Debug.DrawRay(ray.origin, ray.direction * 10, Color.yellow);
Any thoughts on what is going wrong would be awesome. Thanks.