Sprite disappears radomly
So, I am fairly now to Unity and I am creating this simple brick breaker game which i want to export to my phone. The problem is that when i am playing ( i use the accelerometer input to move my paddle on my phone) if i tilt my phone it works for a few trys then the paddle disappears randomly. It moves left and right, (i added quads to the borders and then added coliders to it and it disappeared so then i used the Mathf function and it still happens) Does anyone know why this is happening?
Answer by Awesome_Oposssum · May 26, 2016 at 04:16 AM
I don't know enough about your problem to know if this relates, but I have had similar issues with a disappearing sprite in Unity 2d. Once it was because the sprite moved outside of the camera view, which was easy to see and fix. The other time it was because of rotation. I would make sure that your x and y rotations are not going up to the point that the sprite is flat (once again assuming this is in 2d). The other thing is if the z value for position goes low enough a sprite can disappear. If it isn't any of these, it would help to see screenshots of before and after with the object that is disappearing being selected. It would also help to see the script used to move the object.
Answer by Param1234 · May 26, 2016 at 04:42 AM
I have froze the z and x axis. But i will check the camera view. Thank you for your help.
No problem, I will try to help you solve this problem. If that doesn't work, please add some screenshots so we can see the inspector variables for that object before and after it disappears.