C
C#5d ago
Axivex

Trying to access method from other script

"'GameObject[]' does not contain a definition for 'GetComponent' and no accessible extension method 'GetComponent' accepting a first argument of type 'GameObject[]' could be found (are you missing a using directive or an assembly reference?)" following a 2 year old tutorial here so cant figure out the problem
No description
10 Replies
Angius
Angius5d ago
Notice the s
No description
Angius
Angius5d ago
Plural
Axivex
AxivexOP5d ago
damn
Angius
Angius5d ago
It finds all components with this tag
Axivex
AxivexOP5d ago
that was an easy fix thx
Angius
Angius5d ago
:Ok:
Axivex
AxivexOP5d ago
btw after doing this can I also change public variables for the other script from here?
Angius
Angius5d ago
$tias
Angius
Angius5d ago
But generally, yes. Once you have a reference to an instance of an object, you have access to it's public members

Did you find this page helpful?