using UnityEngine;
using System.Collections;
using System;
public class pickupper : MonoBehaviour {
void Start()
{
if(Input.GetMouseButtonDown(1));
{
RaycastHit hit;
Vector3 fwd = Camera.main.transform.TransformDirection(Vector3.forward);
if(Physics.Raycast(Camera.main.transform.position, fwd, out hit, 100.0f))
{
if (hit.collider.GetComponent<Rigidbody> () != null)
{
//Что будет делать...
}
}
}
}
}