- Home /
Question by
Smaika · Jun 29, 2016 at 09:50 PM ·
c#colliderclickmouseclick
Click On object that has a larger collider
So I have an Object that has a collider and its about double in size of the Object and I use that collider to detect if there is other nearby objects and I need that collider to be there all the time not if I use OnMouseDown();
it will detect clicks even if I clicked outside the object of course because of the bigger size collider so how can I detect click on the object itself?
Comment
Answer by Dayner_Kurdi · Jul 01, 2016 at 01:09 AM
you could have multi child object with different collider to your main object, add a tag to objects collider you want to ignore by the script, for example
void OnTriggerEnter(Collider othe
{
if (other.tag == "Detect_Collider ")
{
return;
}
}