- Home /
Character dissapeared when I hit play
So I had a normal game, everything set up the script is set up exactly how it should be, and everything was fine. I tested it beforehand and it was doing great, but then all the sudden a few days later as I get back to work on developing, I pressed play and the character dissapeared. I looked on the inspector on the right whilst pressing play and noticed my y axis was going into negatives. I stopped playing and it went back to it's normal state, how do I stop my character from well.. falling down?
Answer by Ghostling225 · Dec 22, 2021 at 10:12 AM
I assume you use Unity physics and collisions (the Rigidbody/Rigidbody2D components) for your character to have any sort of gravity and that you have two objects in your scene: the player and the ground it's falling through. Is that right?
Make sure your character object and your ground object BOTH have a collider and that their bounds are correct. Make sure either the ground or the player has a Rigidbody/Rigidbody2D component attached. Then, you should have collisions between your player and the ground and it shouldn't be falling through anymore.
And also , if the character and the ground is touching each other in the editor , there is a chance that when the game is played, the character might clip through the ground. I have seen a lot of game fix this problem by placing/summoning entity with distance from the ground , something like 0.01 above the ground , and because the distance was so small, it is unnoticeable that the character wasn't touching ground when it is summoned.
Your answer
Follow this Question
Related Questions
[solved]Character dissapeared when I hit play 1 Answer
Unity character dissapearing when I hit play 0 Answers
Jump animation with a little bounce like towerfall 0 Answers
Problems with Camera (Camera keeps looking at the feet of my character) 1 Answer
From the video ((SCORE & UI - How to make a Video Game in Unity (E07) )) how to fix ? 1 Answer