fork download
  1. void FixedUpdate()
  2. {
  3.  
  4. if (isHitToGround())
  5. {
  6. Debug.Log("hit");
  7. }
  8.  
  9. Debug.DrawRay(transform.position, Vector2.down - new Vector2(0,0.1f),Color.white, 1f);
  10.  
  11. }
  12.  
  13.  
  14.  
  15. bool isHitToGround()
  16. {//接地判定用のレイキャスト
  17. RaycastHit2D raycastHit = Physics2D.Raycast(transform.position , Vector2.down, 0.1f, groundLayer);
  18. return raycastHit.collider != null;
  19. }
  20.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(1,0): error CS1525: Unexpected symbol `void'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty