{"action":"created","issue":{"url":"https://api.github.com/repos/prime31/Nez/issues/62","repository_url":"https://api.github.com/repos/prime31/Nez","labels_url":"https://api.github.com/repos/prime31/Nez/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/prime31/Nez/issues/62/comments","events_url":"https://api.github.com/repos/prime31/Nez/issues/62/events","html_url":"https://github.com/prime31/Nez/issues/62","id":164991514,"number":62,"title":"RaycastHit distance returning incorrect value","user":{"login":"piedoom","id":8846211,"avatar_url":"https://avatars.githubusercontent.com/u/8846211?v=3","gravatar_id":"","url":"https://api.github.com/users/piedoom","html_url":"https://github.com/piedoom","followers_url":"https://api.github.com/users/piedoom/followers","following_url":"https://api.github.com/users/piedoom/following{/other_user}","gists_url":"https://api.github.com/users/piedoom/gists{/gist_id}","starred_url":"https://api.github.com/users/piedoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piedoom/subscriptions","organizations_url":"https://api.github.com/users/piedoom/orgs","repos_url":"https://api.github.com/users/piedoom/repos","events_url":"https://api.github.com/users/piedoom/events{/privacy}","received_events_url":"https://api.github.com/users/piedoom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-12T04:24:37Z","updated_at":"2016-07-12T14:12:14Z","closed_at":null,"body":"Hopefully I'm not going about this the wrong way, but I have a simple platformer game.  The player uses raycasting to figure out where solid ground is.\r\n\r\n               if (hit.collider != null)\r\n                {\r\n                    velocity.Y = (hit.distance) * directionY;\r\n                    rayLength = hit.distance;\r\n                                    \r\n                    collisions.below = directionY == 1;\r\n                    collisions.above = directionY == -1;\r\n                }\r\n\r\nBasically, the player will move to contact the block by setting the velocity to the remaining space.\r\n\r\nHowever, when I inspect `hit.distance`, it doesn't seem to be the distance of the ray starting at the origin, but the distance from the top-left of the screen.  \r\n\r\nHopefully I'm not just using this wrong/misunderstanding.   "},"comment":{"url":"https://api.github.com/repos/prime31/Nez/issues/comments/232059693","html_url":"https://github.com/prime31/Nez/issues/62#issuecomment-232059693","issue_url":"https://api.github.com/repos/prime31/Nez/issues/62","id":232059693,"user":{"login":"piedoom","id":8846211,"avatar_url":"https://avatars.githubusercontent.com/u/8846211?v=3","gravatar_id":"","url":"https://api.github.com/users/piedoom","html_url":"https://github.com/piedoom","followers_url":"https://api.github.com/users/piedoom/followers","following_url":"https://api.github.com/users/piedoom/following{/other_user}","gists_url":"https://api.github.com/users/piedoom/gists{/gist_id}","starred_url":"https://api.github.com/users/piedoom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piedoom/subscriptions","organizations_url":"https://api.github.com/users/piedoom/orgs","repos_url":"https://api.github.com/users/piedoom/repos","events_url":"https://api.github.com/users/piedoom/events{/privacy}","received_events_url":"https://api.github.com/users/piedoom/received_events","type":"User","site_admin":false},"created_at":"2016-07-12T14:12:14Z","updated_at":"2016-07-12T14:12:14Z","body":"I've created the following gist as a barebones example of the problem I'm having - \r\n\r\nhttps://gist.github.com/piedoom/164969239e2b4bf047768cb9b27c2f54\r\n\r\nRunning this with debug render creates a few colliders and an entity that does a bunch of raycasts.  You can move the raycaster object by clicking down and dragging.\r\n\r\nFor some reason, the hit distance is correct for the raycasts going to the right, but not the raycasts going downwards.  I don't think this is my error since the Debug.drawLine functions appear to look correct."}}
{"actor":{"display_login":"piedoom"}}