Hello. I have been working with that few hours during 2 days and I can’t get what I wanted. And what I wanted? Something like gif above object (3 textures with phone and growing signal). I need visual effect of calling for reinforcement when enemy looks at player. It’s my visualization:
void Preparing(){
radioTexture1.enabled = false;
radioTexture2.enabled = false;
radioTexture3.enabled = false;
}
IEnumerator Calling(){
informing = false;
for (int i=0; i<3; ++i) {
Debug.Log("I'm working! iteracja " + i);
radioTexture3.enabled = false;
radioTexture1.enabled = true;
yield return new WaitForSeconds (0.5f);
radioTexture1.enabled = false;
radioTexture2.enabled = true;
yield return new WaitForSeconds (0.5f);
radioTexture2.enabled = false;
radioTexture3.enabled = true;
yield return new WaitForSeconds (0.5f);
radioTexture3.enabled = false;
}
}
radioTextures 1-3 are GUITexture empty objects with simple texture (childs of my enemy, local position (0,2,0). Any suggestions? I’m going mad, it looks so simple ;_;
I was trying
transform.FindChild("RadarSignalTexture1").position = Camera.main.WorldToViewportPoint(transform.position + 2*Vector3.up);
and it didn’t worked. When I created separate script and using similiar construction in child, it works (but texture is flying in each direction when I’m a bit far from enemy) and I can’t have 3 scripts in this situation and enabling and disabling each other after 0.5s. It’s a bit stupid… Please help