Quantcast
Channel: Answers by "ransomink"
Viewing all articles
Browse latest Browse all 80

Answer by ransomink

$
0
0
Change: `public GameObject projectile` variable type from GameObject to projectile_Controls: `public projectile_Controls projectile` This way, you can access public variables like: `projectile.decay` instead of: `projectile.GetComponent().decay`. Then, when accessing the pooled objects, you can do: // TEST CHANGING FLOAT "DECAY" IN POOLED OBJECTS SCRIPT if (Time.time > 1.5f) { foreach (projectile_Controls pc in pool) { pc.decay = 0.1f; } } // END TEST Sorry if any syntax is wrong. I only use JavaScript...

Viewing all articles
Browse latest Browse all 80

Trending Articles



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