Please help, I don't know what to do

So there’s a BIG problem and I can’t figure it out.
When I click on my grid to spawn my defenders the coordinates are messed up.
For example: the position of the green Rick_Projectile (Rick pickle) is where I clicked with my mouse, when I click my defender (The cactus) spawns in the block near the block where I clicked.
For the trophy it even worse! The red rick_projectile is where I clicked to spawn the trophy and look where it is!

Please help me, I tried to re-watch every video about spawning defenders and my scripts are THE SAME as rick ones…I love this project but this is really mind blowing. I hope someone read this post and eventually help me ):

Hi Allennick,

Welcome to our community! :slight_smile:

Please note, it’s better to copy/paste your code and apply the code fencing characters, rather than using screenshots. Screenshots are ideal for displaying specific details from within a game engine editor or even error messages, but for code, they tend to be less readable, especially on mobile devices which can require extensive zooming and scrolling.

You also prevent those that may offer to help you the ability to copy/paste part of your code back to you with suggestions and/or corrections, meaning that they would need to type a potentially lengthy response. You will often find that people are more likely to respond to your questions if you make it as easy as possible for them to do so.

Regarding your issue, reset the transform of the children of your defenders. Then select the children and move them slightly until they are in the centre of a tile.

Hope this helps :slight_smile:


See also;

I noticed you have a debug log on the position, does the debug message match up with the position of the new instance?

This topic was automatically closed after 14 days. New replies are no longer allowed.

Privacy & Terms