Quantcast
Channel: Questions in topic: "clone"
Viewing all articles
Browse latest Browse all 508

Access the renderer of a clones child object

$
0
0
Ok, I'm becoming desperate here after 2 h of googeling and probably making a really dumb mistake. I'm instantiating arrows where the gameobject is the arrow with the model as a child. When something is hit after a time the arrow destroys itself (which is working fine) but I can't get any fading in because there is no renderer on my childobject. But there is. I've tried stuff like: MeshRenderer[] render = gameObject.GetComponentsInChildren(); Transform childTransform = transform.FindChild("arrow"); MeshRenderer childRenderer = GetComponentInChildren(); Transform childTransform = transform.FindChild("arrow"); and various other things. Also everything with gameObject. or transform. before. But the script is attached to the arrow gameobject so this shouldn't be necessary. Oh and of course I can't access it through the gameobject directly. /edit parent prefab http://i.imgur.com/Bsw6Yrg.png child http://i.imgur.com/K2eYfYx.png in the parent script I stop the arrow once it hits something so it sticks out and turn it to kinematic. later it gets destroyed. the only thing I want to add that doesn't work is a fading effect before it get's destroyed but I always get an error that there isn't a renderer.

Viewing all articles
Browse latest Browse all 508

Trending Articles



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