Defenders are invisible in game

I am working on “Glitch Garden” project. I used mouse position and ScreenToWorldPoint for instantiate cactus clones. But z-axis value of these cactus girths is 0 so they don’t appear on the game screen. I used “Vector3” to solve this problem. How can I fix it with using “Vector2”? I can’t spawn defenders into the grid with “Vector3”.
I am sorry for my English.
Here is my code: https://codeparrot.net/SSPAFuA.csharp

Hi PitoYaga,

Welcome to our community! :slight_smile:

I’ve moved your question to a new thread because the other student’s problem was already solved and did not have anything to do with yours. For future reference, please feel free to create your own thread if you cannot find an open thread with the same problem as yours.

Do the defenders appear in your Hierarchy? If so, maybe they are rendered behind the background. Is the z-position of the background set to 10, the z-position of the camera to -10 and the z-position of the other game objects to 0?

Defenders apppear in Hierarchy. I changed Canvas z-position 0 to 5 and it solved. I tried everything to solve this problem, but I didn’t think to change the canvas position. I always forget it. :sweat_smile:
Thank you. Problem solved.

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

Privacy & Terms