I made a demo in Unity where I placed an empty GameObject near a door, added a Box Collider to it, and set it as a trigger so that I can detect OnTriggerEnter. When the player moves into this collider, I use SceneManager to load a target scene and move the player to a predefined spawn point in that scene (the spawn point is an empty GameObject in the target scene, and the player is positioned at that object’s transform).
In the Unity Editor and in the built executable on my own computer, scene transitions work correctly. However, after I sent the built .exe to my friends, they reported that when the player approaches the door, the player does not appear at the correct spawn point. Instead, the player sometimes appears in a location without a floor and falls downward.
I have three questions and would appreciate any help:
Why does the player sometimes fail to land exactly at the spawn point?
This seems to be a probabilistic issue and happens very randomly. Sometimes the player spawns correctly, and sometimes an error occurs. (The exact behavior can be seen in the video.)
Why does everything work perfectly in the Unity Editor and in the built executable on my own computer, even after entering and exiting the room 20 times, but consistently fails on my friends’ computers?
Why does the player appear to be floating and not tightly attached to the ground, even though I apply gravity in my code?