My paddle didnt appear in the both scene and game view,but i am still able to move the paddle and see the balls bounce.
Need to adjust the z axis of the paddle. Its hiding behind the background right now.
A good way to check how is the depth of your 2D project is to click on the “2D” button (in your printscreen on Scene window, besides Shaded option).
Following David response, adjust the z axis of the paddle and it should be alright!
i just adjusted the z axis of the paddle and it finally showed up in the scenes,but when it comes to play mode,it still disapper in the both sence.
That’s because the z axis is back to 0, in the code you can change the vector2 into a vector 3 for the paddle position and change the z axis there.
the axis of my balls is also back to 0 too,but why i only can see the ball?
Hi Kelvin,
Is your background set to z = -10? If the background and other game sprites are on the same z-layer, sprites could be invisible due to the infamous z-fighting effect.
Updated Mon Oct 28 2019 14:34
Sorry, meant z = 10.
See also:
- Wikipedia: Z-fighting
Try to set your background to z = 10.
it now works fine. thank you very much Nina, but i still dont understand why should set the background to 10.
Have you already read the article on Wikipedia?
If two or more sprites share the same position, the renderer does not know which one to render first and which one last. It renders the sprites in an arbitrary order. It could be that the ball suddenly becomes visible, and a few seconds later invisible. That’s the infamous z-fighting effect. You can avoid the problem by giving game objects on different z-positions.
i should have read the article you provided.anyway thank you so much Nina…
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.