hi, i made a gun system but when i drop a gun it falls through the terrain. anything i need to explain further ill be around, heres my code, however im not sure it has to do with my code. ill also leave my project for people to have a peek.
using UnityEngine;
using System.Collections;
public class Gun : MonoBehaviour {
public GameObject Weapon1Get;
public GameObject Weapon2Get;
private GameObject WeaponDropped;
void OnMouseDown () {
Debug.Log ("YES");
WeaponDropped = Weapon1Get.GetComponent <Weapon1> ().CurrentWeapon;
WeaponDropped.collider.enabled = true;
WeaponDropped.rigidbody.detectCollisions = true;
collider.enabled = false;
rigidbody.detectCollisions = false;
Weapon1Get.GetComponent <Weapon1> ().CurrentWeapon = gameObject;
}
void OnCollisionEnter (Collision Col)
{
if (Col.gameObject.tag == "Player")
{
Physics.IgnoreCollision (collider, Col.gameObject.collider);
}
}
}
https://drive.google.com/file/d/0B2ZiQtohl3tmdXpXVmRNNmxSTTQ/view?usp=sharing