|
Greetings, I would like to know if it's possible for the function OnTriggerEnter to apply to a specific child of the object or does it absolutely need to be on the object that use it.
(comments are locked)
|
|
if the collider that u use as a trigger is on the child and the script with OnTriggerEnter function as well then you can use it !!... if it has to be on parent Gameobject for sure then u can attach the script to the parent and from the parent's OnTriggerEnter you can call a function on that specific child using SendMessage function Actually, from the parent script I want the OnTriggerEnter to apply to the collider that reside within the Children. I already know I can send a message from a Children to the Parent, but I'm trying to keep a clean and efficient code. So I would like to avoid creating a new script if not necessary.
Dec 19 '11 at 04:34 AM
Oninji
hmm OnTriggerEnter would work in the script, if it is attached to the gameobject that has collider. As far as i know it is not possible without attaching a script to the child!! anyway take a look at Raycast, ma be come up with a logic. I am too sleepy to think of anything lol
Dec 19 '11 at 06:10 AM
flamy
(comments are locked)
|
