In the Coroutine i want to change the shader of the objects with tag “obstacle”
From - MADFINGER > Diffuse > Simple
To - Mobile > Background
Please guide me
In the Coroutine i want to change the shader of the objects with tag “obstacle”
From - MADFINGER > Diffuse > Simple
To - Mobile > Background
Please guide me
Have you tried Material.shader?
is there any mobile shader which makes my object semi transparent ?
and secondly, how do i switch its “Is trigger” value ??
Usually the shaders that come with Unity are sufficient. Just try the usual transparent shader where you can adjust the the transparency with the alpha of the color property.
The other on is here:
how do i address that object ? I need to do this from a seperate script, will it be like -
foreach(GameObject go in GameObject.FindGameObjectsWithTag(“obstacle”)) { collider.isTrigger = false; }
Yes, you can mostly do it like that. But that works only if all the game objects with the tag “obstacle” contain a collider.
GameObject[] obstacleGameObjects = FindGameObjectsWithTag ("obstacle");
foreach (GameObject go in obstacleGameObjects) {
go.collider.isTrigger = false;
}