Skip to content

Instantly share code, notes, and snippets.

@antonkudin
Created September 14, 2014 17:50
Show Gist options
  • Save antonkudin/0cb9f96dbf525eca119d to your computer and use it in GitHub Desktop.
Save antonkudin/0cb9f96dbf525eca119d to your computer and use it in GitHub Desktop.
void putToFloor(){
RaycastHit2D hit = Physics2D.Raycast(transform.position, -Vector3.up);
if (hit.collider != null)
{
transform.position = hit.point;
Debug.Log ("Putting here: "+transform.position);
}
Debug.Log ("Found nothing to hit: " + hit.point);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment