Defender Prefab is not instantiate at clicked position in CoreGameArea

when i clicked mouse button to instantiate cactus .it is instantiate at random position in CoreGameArea.i followed rick from starting point but why this is happening?
for ex: when i clicked at (0,0) position then cactus is instantiate at (2,2) position .

Hi Sunil,

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.

If this is not a problem with your code, check the animation. Make sure he position is not animated.

Hope this helps :slight_smile:


See also;

1 Like

Thanks Nina for proper guidance. i really appreciate your responce

You’re welcome. :slight_smile:

How are you getting on with this?

Continuing the discussion from Defender Prefab is not instantiate at clicked position in CoreGameArea:

Thank you sir for giving attention on me.this problem was solved before .actually i forgot to reset the transform of parent and child gameobject to zero.now its instantiate at clicked position.

i am new in game development field .i am really glad that people are very helpful here and always help others

I’m glad you were able to fix the problem. :slight_smile:

1 Like

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

Privacy & Terms