- Home /
Basic: How do you get a script to trigger OnMouseOver for moving child?
I have a card that's animated along a path. The root joint on the card has a box collider, so that it moves with the card. The holder for the joint and geo has this script:
using UnityEngine;
using System.Collections;
public class selectedCard : MonoBehaviour {
//protected Animator anim8r;
//void Start()
//{
// anim8r = GetComponent<Animator>();
//}
void OnMouseDown()
{
//animator.SetBool("draw",true);
Debug.Log ("Ping1");
}
void OnMouseEnter()
{
Debug.Log ("Bling");
}
}
I'm trying to get it to eventually modify a parameter to draw the card, but for now I would like it to just register the hit. This works on a stationary object, but when I try this on an animated bone, despite posts saying this should work, nothing happens. I don't know if this is because I'm using OnMouseEnter or what.
The documentation on how script and colliders interact with animators hasn't come up in a single search of probably about 50 searches. What I've cobbled together is from the raycasting tutorial video, one lacking page about setBool and random code hints in other people's answers. If anyone knows a definitive site for how animation, scripts and colliders work across multiple objects, I would be ecstatically grateful.
Your answer
Follow this Question
Related Questions
Charactor Controller Collision 0 Answers
Fog On and Off Script Help! 2 Answers
Script doesn't find other script 0 Answers
adding collider to a child object (script) 1 Answer
Turn On - off character controller script, is there a way?? 3 Answers