Unity
0
Вклад в тег
Ray cameraRay = Camera.main.ScreenPointToRay(Input.mousePosition);
Plane groundPlane = new Plane(Vector3.up, Vector3.zero);
float rayLength;
if(groundPlane.Raycast(cameraRay, out rayLength)){
Vector3 pointToLook = cameraRay.GetPoint(rayLength);
transform.LookAt(new Vector3(pointToLook.x,transform.position.y, pointToLook.z));
if(Input.GetMouseButtonUp (0)){
transform.position = Coll.position;
EndFishkaEvent();
}
}