Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

getting correct instance of script from multiple

$
0
0
Hello there.

I am trying to get the correct instance of a script<Soldier> referenced in a projectile from multiple instances of the same enemy
the way i did this is to instantiate the projectile as a child and on its awake method, call getcomponentfromparent<Soldier>
i need to alter the parents localscale without affecting the projectile, to do so i call transform.setparent(null) a couple seconds after this projectile is instantiated so that i may freely affect the parent localscale...

getting correct instance of script from multiple

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>