The different scenes have different places in Z?

So this will be like my 5th post throughout this course, but here goes.

I currently have 3 scenes with levels in my game (have 2 more, but not done anything on them yet).
It seems that they are all on different positions on Z, when I click on the 3d camera, that is.
When I add Coins with scene 1 loaded in, the coins get added.

When I try to use prefab coins on the 2nd level, they are still in the same Z position as the level 1 scene.

I tired creating new coins for the level 2 scene, but they wont show (when I collide with these invisible coins, I still get points though).

Any clue why this happens? Can add a screen shot of the 3d camera if reuqested.

Hi Matthias,

Which version of Unity do you use? What did you do with the coins you created from your prefab? Did you move them around in your second scene and they ended up at the same position in the first scene?

Maybe it helps if you could share a few screenshots of all relevant game objects involved.

Hi Nina! I use unity 2018.3.3f1.

I used the prefabbed coins and dragged it in from prefab folder in to my 2nd scene. I double checked so that they werent in the same position as the first scene as in the second.

I managed to “solve” this by duplicating my main menu screen, redo the cameras for the 2nd level and just copy over the grid and all other assets to the newly duplicated scene, and then the camera were in the right position next to the other two.

THe issue I had at first were that the coins I put in from prefab to 2nd scene was that they were “behind” the camera, and the problem was that the camera and the grid were miles away from eachother in distance as compared to main menu scene and 1st level scene.

I can no longer submit a screenshot as I deleted that eyesore of a messed up 2nd level scene. But resolved the issue as I stated above.

if you have any idea why that might have happened I would like to know, in case something similair happens in the future.

Thanks for your ongoing support!

Did you drag the prefab directly into your scene? If so, that could be the issue. Unity does not know where the game object is supposed to be located, so it just spawns it somewhere near the position of your mouse.

For this reason, I almost never drag anything directly into the scene but into the Hierarchy only.

I’m pretty sure I dragged it in to the Hierarcgy, as I have done that with everything that is preffabed (if I remember correctly), I may have forgotten and dragged it directly in to the scene.

Now everything is working accordingly however and I can finally continue to develop the platformer further with help of videos from youtube, along with some testing and playing around with settings

I’m glad everything is working as intended now. :slight_smile:


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms