I was a bit surprised that, when using the RayCastHit structure, we had to go via .transform or .collider in order to get access to the method GetComponent(). It’s in the documentation so I was able to find it, as part of the challenge. Documentation is great.
I was just surprised to see that it was the transform component that enabled using this method. Rather than, I dunno, .gameobject or something more general. transform is just about position and shape and whatnot - I didn’t quite understand how or why the transform would ‘know how’ to use GetComponent.
Is the transform component of game objects something that ‘stores’ an awful lot of functionality? Is this particular to RayCasHit structures, or is .transform generally quite handy for enabling calling methods?
Thanks. I hope this question makes sense!! X-D