Hello.
I have problems with prefab on android.
I have prefab - Player. When I change him sprite - it does not change, but in Unity Editor everything ok.
You’re going to probably have to post some code before anyone can help you. Be sure to review Code Formatting Guidelines for this forum or else your code will be unreadable and again nobody will be able to help you.
public GameObject Player;
if (num == i && Itemses[i].Price == 0)
{
for (var j = 0; j < Itemses.Count; j++)
{
Itemses[j].ActiveRocket.SetActive(false);
Itemses[j].IsActive = false;
}
Itemses[i].IsActive = true;
Itemses[i].ActiveRocket.SetActive(true);
Player.GetComponent<SpriteRenderer>().sprite = Itemses[i].Prefabs.GetComponent<Image>().sprite;
}
a small piece of code
Do you dynamically load the .Prefabs field of the Itemses chunks? This can fail if you don’t put your files int he right place.
Have you debugged the steps of this to ensure what you think is happening is actually happening, such as the first condition on line 3 actually firing?
What about inserting some debug log outputs at various places to tell you some more info when running on the device and watching the device log?
Thanks, but I find a solution. The problem was in an object on the scene.
I have 2 scene with the object Player, But now I use prefab.