Quantcast
Channel: Questions in topic: "class instance"
Viewing all articles
Browse latest Browse all 131

How to apply script saved in variable

$
0
0
Hi to all. I want to add a component saved to a variable from "heal heart" to a character, who will collide with it. I dont want to use col.gameObject.AddComponent (); Because there will be several different effects, and I want only to change effect. I tried something like col.gameObject.AddComponent (); col.gameObject.AddComponent(typeof(testHeal)); This is all wrong. If there is other, more correct way, tell me pleae, thank you! ![alt text][1] [1]: /storage/temp/112513-boster.jpg

Viewing all articles
Browse latest Browse all 131

Trending Articles



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