Question by
FordUser01 · Jun 23, 2017 at 04:15 AM ·
collideronmousedownfps controlleristrigger
OnMouseDown not working under Character Conroller
I am trying to parent an object to my FPScontroller (that is default from unity) and have a box collider that when clicked, it does something. If I un-parent the object, it works, if I parent it to my FPScontroller, it doesn't work. Any ideas?
The code is super simple:
public class PhoneUnlock : MonoBehaviour {
// Use this for initialization
public GameObject VehicleCollider;
private void OnMouseDown()
{
Debug.Log("Vehicle Unlock");
VehicleCollider.SetActive(false);
}
}
Comment