#how do i get the script of a child

1 messages · Page 1 of 1 (latest)

twin stag
#
foreach(Transform child in transform) {
  // if this is the child you want, maybe via a transform.gameObject.name == "the one I want"
  transform.GetComponent<TheScriptImAfter>().SomeFunctionOnThatScript(someVariable)
}```
#

But yeah these are probably better suited to code-beginner