2d Raycast From Mouse Code Example


Example: unity 2d raycast mouse

// detect object that was clicked using raycast  RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);   if(hit.collider != null) {     Debug.Log ("Target name: " + hit.collider.name); }

Comments

Popular posts from this blog

Chemistry - Bond Angles In NH3 And NCl3

AspenTech InfoPlus 21 - How To Connect And Query Data

Can Not Use Command Telnet In Git Bash