Quantcast
Channel: Answers for "A Question about GetComponent() (when accessing scripts)...."
Viewing all articles
Browse latest Browse all 6

Answer by Loius

0
0

Use

var newTroop : GameObject = Instantiate( troopObject );
newTroop.GetComponent(WayPointScript).target = clickedTransform;

Then newTroop will be set to your newly instantiated troop object.


Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles



Latest Images