Timeline for How to detect collision occurring on a child object, from a parent script?
Current License: CC BY-SA 3.0
2 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 3, 2017 at 19:25 | comment | added | Lunin | If you use a solution like this and these collision happen a lot, I highly recommend having the children cache their receiving parent's GameObject. It's a good habit any time you're going to be calling the same GetComponent a lot and allows you to make any of the trickier "finding which parent up the chain to send to" logic only need to happen once. Also remember that transform.parent will only get the immediate parent. | |
| Dec 3, 2017 at 12:48 | history | answered | user100681 | CC BY-SA 3.0 |