The player shows up and works fine in the editor, however when I make a build the player does not show up, I have hidden all background images and it still does not show up, he is sat on z-axis of 0 and is in a sorting layer, however, I don’t think it’s a camera issue as i don’t think the game object is in the game or not as no sound effects are being played.
I really don’t know how to fix this issue as i cant even figure out why its doing it, does anyone have any idea?
Hi, I’ve done some more digging, I made a new game file completely and I can replicate the issue just by adding a Rigidbody2D to a sprite, it disappears when I build the game but not in-game view, no code attached.
So small question but big implications: Do you have a floor or platform for the player to land on? I just wonder if the by the time it loads on your build that the player is technically still there but is just falling down and out of the camera’s view. You can try turning off gravity on the Rigidbody2D to test that out (if you dont have a floor with a boxcollider2D to land on). Make sure to add a collider2D of some kind to the sprite with the rigidbody.
If yes, that is incredibly bizarre and a bug. Try using a different version of Unity. You can also share your inspector from when clicked on the player showing all the components and their settings, try that before re-installing.
Yep thats it, by the time the game loads the player falls, at least i have figured out whats happening now.
but not sure how to solve the problem, would i have to hold the player there for 5 seconds or x amount of time. or is there a better way? this is Unity 2020.3.9 so surely it cant be the version causing that?
Just changing the gravity scale to 0 should have done the trick. However, if you dont change the gravity scale to 0 it should fall. If you place a floor that has a collider2D it shouldnt fall through it will just fall onto it.