Prefab spawn script not Working on android.

Hi! I’m trying to remake the Flappy Bird game but I have one small problem: The pipes won’t spawn. The thing is that in unity works fine but on android nothing is spawned.

Here is my code for the spawning mechanism:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PipeSpawner : MonoBehaviour
{

    public static PipeSpawner Instance;
    public float maxTime = 0.5f;
    private float timer = 0;
    public float height = 1.5f;

    public List<Transform> pipeList;
    public GameObject pipe;
    // Start is called before the first frame update
    void Awake()
    {
        pipeList = new List<Transform>();

        if (Instance == null)
        {
            Instance = this;
        }
    }

    void Start()
    {
        GameObject newPipe = Instantiate(pipe);
        newPipe.transform.position = transform.position + new Vector3(0, Random.Range(-height, height), 0);
        pipeList.Add(newPipe.transform);
    }

    // Update is called once per frame
    void Update()
    {
        if (timer > maxTime)
        {
            GameObject newPipe = Instantiate(pipe);
            //pipeObject.position += new Vector3(-1, 0, 0) * GameControl.Instance.scrollSpeed * Time.deltaTime;
            newPipe.transform.position = transform.position + new Vector3(0, Random.Range(-height, height), 0);

            timer = 0;
            pipeList.Add(newPipe.transform);
        }
        timer += Time.deltaTime;

    }
}

I also have a small script for the pipes to move them and destroy them:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PipeControl : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        transform.position += new Vector3(-1, 0, 0) * GameControl.Instance.scrollSpeed * Time.deltaTime;
        if (transform.position.x < -14.96f)
        {
            Destroy(transform.gameObject);
        }
    }
}

Actually i don’t know, but i may give you some hints:
1- Are you sure your script is executed on the device (if not sure try to add a sprite and change it’s color in the Start function) to make sure that your script is executed.
2- Do you use any material for the pipe sprite (if yes, maybe the material do not work on android).
3- Try to instantiate them at position (0,0,0) to make sure that it is not a canvas problem or a camera position or a screen ratio.
4- If nothing works, then may god be with you :).

It looked that the object spawned but the problem is the resolution scale. Everything on my phone looks bigger than in Unity. I’m currently looking for a fix to that.

5366136--542907--Screenshot_20200113-005357.jpg

do you use a canvas to scale the pipes or instantiating the pipes outside the canvas?
if using a canvas, then correct it’s settings or watch a tutorial for canvases on YouTube.