Help With A Collision While Using Physics

Hi there, I am making a game where you have to pickup, and carry a object to a certain place.
Heres my problem.
I have made the object pickup-able, i can carry it around with the mouse.
But when it touches something, it doesn’t collide.
It just goes right through the object, and i need it to have collision:(.

Here’s images to show what i mean

30678-2.png

Heres my script Thus far.
using UnityEngine;
using System.Collections;

public class PickupObject : MonoBehaviour {
	GameObject mainCamera;
	bool carrying;
	GameObject carriedObject;
	public float distance;
	public float smooth;
	// Use this for initialization
	void Start () {
		mainCamera = GameObject.FindWithTag ("MainCamera");
	}
	
	// Update is called once per frame
	void Update () {
		if (carrying) {
			carry (carriedObject);
			checkDrop();
		}else {
			pickup();
		}
	}
	
	void carry(GameObject o) {
		o.transform.position = Vector3.Lerp (o.transform.position, mainCamera.transform.position + mainCamera.transform.forward * distance, Time.deltaTime *smooth);
	}
	void pickup() {
		if(Input.GetKeyDown(KeyCode.E)){
			int x = Screen.width /2;
			int y = Screen.height /2;
			
			Ray ray = mainCamera.camera.ScreenPointToRay(new Vector3(x,y));
			RaycastHit hit;
			if(Physics.Raycast(ray, out hit)){
				Pickupable p = hit.collider.GetComponent<Pickupable>();
				if(p != null) {
					carrying = true;
					carriedObject = p.gameObject;
					p.gameObject.rigidbody.isKinematic = true;
				}
			}
		}
	}
	
	void checkDrop(){
		if(Input.GetKeyDown (KeyCode.E)) {
			dropObject();
		}
	}
	void dropObject() {
		
		carrying = false;
		carriedObject.gameObject.rigidbody.isKinematic = false;
		carriedObject = null;

	}
}

yes, its ugly. I know.

But can you help me to fix this?
Please?

If it is to do with isKinematic then you can change it in two ways which i know off:D

rigidbody.isKinematic = false;

Or manually go to its rigidbody and un-tick it.

30680-iskinematic.jpg

You also might need to take out:

p.gameObject.rigidbody.isKinematic = true;

I’m not sure though, try it:D

That should fix your problem :smiley: