3d with sprites problem

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


)

1 Like

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

Ok, are you applying any scaling to any of the game objects? It could explain why the bushes move faster on the y-axis and seem to disappear.

Perhaps you could share a minimal project here where the problem is reproduced?

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?)

Create a zip file with all of the files required to run the project.

Here is the mini project which reproduce the problem:
mini project.zip (8.1 MB)

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:

1 Like