My Player Gameobject disappear (falling down) after build

Hi,

my game is running fine in unity editor and after building on the same PC. But when i try the game on another computer, my player’s gameobject is falling down and disappear at startup…

The player is a ship in space who stays in the middle and goes straight ahead. I can rotate it on itself with the script. I have any problem in editor or with a build on the same PC.

When i try the build on another PC, the Ship falls as soon as the game starts as if there was a rigidbody with gravity.

I try with rigidbody and no gravity _> same problem.

I try to remove rigidbody → same problem.

I try with rigidbody and Freeze X Y Z position → same problem.

I try to debug but the log don’t tell something usefull.

After many tries, i found that the C# script is reponsible of that. If i disable the script, the gameobject is not falling.

The script is simple and comes from unity example. It makes rotate the Gameobject with the mouse.X mouvement :

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
     
    public class Rotate : MonoBehaviour
    {
        public float speed = 10.0f;
        public float rotationSpeed = 800.0f;
        public float moveSpeed = 3f;
         public GameObject Roue;
       
       
        public float startingPitch = 0.8f;
        public int timeToDecrease = 5;
        AudioSource audio;
       
       
         void Start() {
            audio = GetComponent<AudioSource>();
            audio.pitch = startingPitch;
        }
     
        void Update()
        {
           
            moveSpeed += 0.1f * Time.deltaTime;
           
    startingPitch += 0.01f * Time.deltaTime;
                audio.pitch = startingPitch;
     
           
           
            Roue.transform.Translate(Vector3.forward * Time.deltaTime * moveSpeed, Space.World);
            // Get the horizontal and vertical axis.
            // By default they are mapped to the arrow keys.
            // The value is in the range -1 to 1
            float translation = Input.GetAxis("Vertical") * speed;
            float rotation =  Input.GetAxis("Mouse X") * rotationSpeed;
           
            //float rotation = Input.GetAxis("Mouse ScrollWheel") * rotationSpeed;
     
            // Make it move 10 meters per second instead of 10 meters per frame...
            translation *= Time.deltaTime;
            rotation *= Time.deltaTime;
     
            // Move translation along the object's z-axis
            Roue.transform.Translate(0, 0, translation);
     
            // Rotate around our y-axis
            Roue.transform.Rotate(0, rotation, 0);
        }
       
               
     
           
    }

Thanks in advance for your help, i don’t know what to do…

Hi, a small up…

I see many people have problem after building the game.

If you have a solution… Many months of coding for a non working game, i’m disapointed…

Thanks

Input.GetAxis might be the problem. One of my PC’s had a joystick connected which was sending some signal other than (0,0) for some reason. If you have a conflicting hardware setup this may lead to a behavior like “S key is always pressed”.