Hey, so I started playing around with 3d and made a never ending runner type game in first person. The setting is a forest in which the character advances. However when I implement bushes (and actually any game object that I generate) they get swollen to the ground the closer they get to the camera…
(in blue the full bush and in red the swollen one
It’s very hard to guess why this is happening. Which elements are in 3D and which are 2D sprites? You’re using a perspective camera? How are you moving the game objects?
ok so,
all elements are sprites,
I think they all are 2d sprites (I just use the normal built in sprites)
I use a perspective camera (just one which I added myself)
The floor is made of 7 sprites which move on the z axis towards the camera and repeatedly placed backwards when reach the camera.
The other sprites (the bushes and elephants)move the same only the are generated by a factory in some distance point on the z axis
I did not apply any scaling on the objects (but out of curiosity is scaling changes the speed in which the objects move?)
I tried to move the bushes up the y axis the closer they get to the camera thinking that it will solve the problem because the bushes will be going up but it didn’t work
I have tried to play around with the positions of the sprites too but to no avail.
It seems to me that the camera just show for some reason the “ground” object above the “bush” object and I can’t understand why.
(how can i share a minimal project? just copy and paste the code?)
ok, so I found out that I needed to edit the render script so that the “depth testing” will be true when rendering sprites, and it did solve the current problem, however know i am facing another problem which is visible in this picture: