0

My 2 player android Unity game is working just fine in Unity remote 5, I have a small minigame where there are multiple coloured tiles and coloured buttons and so to match a tile, u have to click the right button and as quick as possible before the other player, during start all the tiles are properly generated in Unity remote 5 but when the game is built and ran on my Nokia phone then there is just 1 tile that spawns I think and the other player's ones doesnt even spawn, that is just one issue, there are other issues in other games. Plus the first scene has a gameobject spinning, in Unity remote 5 it spins in a good speed but in build it spins super slow, like way too slow.

I made new Unity project and transferred everything there to see if it would work but it didn't. I also dont have any device-specific code I think, I have input.touch but that is becuz its an android game. I don't know what else to try, in the player/project settings, I have done IL2CPP for ARM64 and that is the only change I have made, what else could I change?

1 Answers1

0

Unity Remote 5 is not playing a build. it is just a mirror. therefore, if a game plays on editor it plays on Unity Remote 5 as well.

for other issues there might be several different problemes. Here I will share most common ones:

  • your PC's frame rate is different than your phone and each device can be different. Therefore you cannot relay on it. you have use "time.deltatime". example code:

    transform.Rotate(0, 0, degreesPerSecond * Time.deltaTime);

link for details

  • if your other player spawns in the Unity editor. its is spawning in the phone as well for sure. however most probably you are not using proper layers. I suggest you work on canvas and panel based. so you can easily sort them and give order when to show up when to hide.

probably your player stays behind an item see the attached image

image

Sirhot Bay
  • 63
  • 6
  • This is the script for the rotation IEnumerator Anwation() { yield return new WaitForSeconds(0.01f); yield return new WaitForSeconds(0.01f); while (true) { yield return new WaitForSeconds(0.005f); playmator.transform.Rotate(Vector3.forward * 1.5f * Time.fixedDeltaTime); } } Also in Unity remote 5 it always shows the tiles properly, it is always above all layers so why not on phone? And btw the other tiles simply do not exist becuz no effect takes place when I press the buttons. – TFO Society Jul 02 '23 at 10:48
  • fixedDeltaTime is not necessary in my opinion. you should try Time.deltaTime. Also use a public variable to adjust speed on run time to see what is best speed, instead of hardcoding. – Sirhot Bay Jul 02 '23 at 11:51
  • for the layer issue, I cannot comment at all since I do not know the your project top to bottom. However, you should understand that phone layer logic and unity is not the same. Unity may adjust the layers eventhough you do give wrong order. however your phone will not know this. therefore you should be carreful when you are sorting the layers. if you are using panels or just drag droped items, make sure that on hierarchy: what is on the bottom will be seen on the top when playing and vice versa. – Sirhot Bay Jul 02 '23 at 11:51
  • also avoid to use yield return unnecessarily. chec the code below: – Sirhot Bay Jul 02 '23 at 11:51
  • public float speedRate = 1.0f; IEnumerator Anwation() { yield return new WaitForSeconds(0.02f); while (true) { yield return new WaitForSeconds(0.005f); playmator.transform.Rotate(Vector3.forward * speedRate * Time.deltaTime); } } – Sirhot Bay Jul 02 '23 at 11:51
  • Ok I will change that, I really don't think layers are the issue at all because whenever the tile is matched or not matched, then an audio clip plays so that means even if it is behind one layer or ahead then it should still play an audio clip meaning only one is generated and btw all tiles are on same layer so either none should be seen or all should be seen. So there is some other issue, the game isn't functioning correctly. – TFO Society Jul 02 '23 at 12:00
  • if you are making custom tiles. I would recommend you check the images on the inspector. maybe texture type is different then sprite(2D and UI) or maybe Pixels Per Unit is too big or too small. – Sirhot Bay Jul 02 '23 at 12:04
  • one last thing you may download MuMU player and try ur apk on different phones. maybe your Nokia does not support some stuff. – Sirhot Bay Jul 02 '23 at 12:07
  • By tiles I meant like the colour matching game, not tilesets, there isn't a problem with graphics, the game looks neat with graphics, maybe I should give u the game https://drive.google.com/file/d/115O2tzOO_Iq_FnRAOxmSODk3QmsAvJp-/view?usp=drivesdk u can see that the home button works in the level select scene but not when u play the space ship game or any game really. Ok I will download MuMU player but the thing is I want the game to be playable for everyone and everyone will not download this MuMU so that's a prob because I am going to publish on play store – TFO Society Jul 02 '23 at 12:28