Horje
unity check when clicked on object Code Example
unity check when clicked on object
 
void Update()
{
  // Check for mouse input
  if (Input.GetMouseButton(0))
  {
  	Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
   	RaycastHit hit;
   	// Casts the ray and get the first game object hit
   	Physics.Raycast(ray, out hit);
   	Debug.Log("This hit at " + hit.point );
  }
}




Csharp

Related
unity how to wait for seconds without coroutine Code Example unity how to wait for seconds without coroutine Code Example
monogame fullscreen Code Example monogame fullscreen Code Example
path desktop c# Code Example path desktop c# Code Example
c# summary link Code Example c# summary link Code Example
c# remove newline from string Code Example c# remove newline from string Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10