GetComponent<Renderer>().material.mainTexture = Resources.Load("textures/1") as Texture; 1 answer
Do i do the best way?
I rotate inside the GameObject child GameObject2 with the rotated coordinate Rotation z 180
Taken from here http://www.gamedev.ru/code/forum/?id=163254
- Simplest. We create an empty GameObject, a subsidiary to it is a "shell" (Simply drag the "shell" onto the created empty GameObject). Then we turn the child "projectile" as necessary.
- Is this the answer or the continuation of the question? - Valera Kvip
- This is a bad decision. Now I can not access the nested object.
GetComponent<Renderer>().material.mainTexture- codename0082016 - docs.unity3d.com/ScriptReference/Transform.GetChild.html - Valera Kvip
- Finish
GetComponentInChildren<Renderer>().material.mainTexture- codename0082016
|
