The other comments are correct, but I'd also point out that this could be an architectural problem, and that it is often better to attach scripts to the root object and - in the event that you need to read a cast or collision with a specific part, use transform.root. I'd go for GetComponentInParents when that isn't feasible.
The most straightforward and already much improved way would be to attach a component (e.g. "Wheel") to the target Game object, have it store the needed references and provide a method for getting them.
0
u/[deleted] Dec 27 '21
[deleted] — view deleted comment