I'm working on a simple 3D tooltip that uses a box collider. But the hierarchy containing the tooltip gets parented to an object with a rigid body. This kills the `OnMouseOver` and `OnMouseEnter` events for my child collider (Though, `Update` functions in the child's script still work fine). If I `Destroy` the rigid body on the parent, `OnMouseOver` on my child comes back to life. Tried disabling various properties of the rigidbody. Didn't help.
Is there a way to work around this? Is there a better way to do this?
var card : GameObject;
function Start () {
card.SetActiveRecursively(false);
}
//this part works after parenting - using it to verify script is working
function Update () {
if (Input.GetKeyDown ("o")) {
card.SetActiveRecursively(true);
}
if (Input.GetKeyDown("i")) {
card.SetActiveRecursively(false);
}
}
//this part stops working after parenting
function OnMouseEnter () {
//activate the card
Debug.Log("MouseEnter");
card.SetActiveRecursively(true);
}
function OnMouseExit () {
//deactivate the card
Debug.Log("MouseExit");
card.SetActiveRecursively(false);
}