I am trying to access a value inside the object I collided with.
I have searched Google and I have tried various things.
This is what I have now, GetValue is just a public int Getter inside Walker:
2 Likes
Hello Retro,
What is the name of the walker’s script with the GetValue public int?? is it GetValue?
1 Like
Yes it is called GetValue()
2 Likes
but the script? the MonoBehaviour?
1 Like
1 Like
you should be using:
walker = col.gameObject.GetComponent<Walker>();
TMP = walker.GetValue();
planeShoot.AdjustScore(TMP);
GetValue is the method inside “Walker” MonoBehaviour, GetComponent should be used to access the script in order to TMP access the GetValue()
1 Like
it worked?
1 Like
Awesome!!
1 Like