minimap circle not moving

Hello awesome people

I was following this tutorial

Whatever I do, my circle / sprite shape don’t move as the player moves.

It should be straight forward… Please advice…

Steps taken:

· Create an empty as a child of the player and name it miniMapICon

· Give it a sprite render and give it a circle and a color.

· Put the miniMapIcon on a layer called miniMapICON

· Main camera has the minimap layer disabled

· Duplicate the main camera and set it to untagged and set its layer to only minimap

· Make this camera a child of the main camera.

· Create a render texture, set its size 512 x 512

· Drag it into minimap cam target texture

· In a UI canvas, create an empty and name it minimapRenderTex

· Create a RAW image under the empty

· Drag the rendertexture into the RAW.

· Set the background color

From here on the dot/sprite should move on the minimap, but it does not.

I have a couple of other scripts on my main camera, but i tried with and without them enabled as well.

Code Monkey sets the duplicate camera’s culling mask to Minimap and leaves the layer as Default (2:26 in video).

As before and as always, what is often happening in these cases is one of the following:

  • the code you think is executing is not actually executing at all
  • the code is executing far EARLIER or LATER than you think
  • the code is executing far LESS OFTEN than you think
  • the code is executing far MORE OFTEN than you think
  • the code is executing on another GameObject than you think it is

To help gain more insight into your problem, I recommend liberally sprinkling Debug.Log() statements through your code to display information in realtime.

Doing this should help you answer these types of questions:

  • is this code even running? which parts are running? how often does it run? what order does it run in?
  • what are the values of the variables involved? Are they initialized? Are the values reasonable?
  • are you meeting ALL the requirements to receive callbacks such as triggers / colliders (review the documentation)

Knowing this information will help you reason about the behavior you are seeing.

You can also put in Debug.Break() to pause the Editor when certain interesting pieces of code run, and then study the scene

You could also just display various important quantities in UI Text elements to watch them change as you play the game.

If you are running a mobile device you can also view the console output. Google for how on your particular mobile target.

Here’s an example of putting in a laser-focused Debug.Log() and how that can save you a TON of time wallowing around speculating what might be going wrong:

https://discussions.unity.com/t/839300/3

Kurt Thank you for the “Debug solution” as always…

But there is no coding here… It’s all UI Which is also why I did not post in scripting…

Yes I did all that…

That just means positional data is being transferred some other way. Figure that out, figure out why it’s not being transferred. You might benefit from writing a script to reveal what positions are what, or perhaps start back at the beginning of the tutorial and make sure you understand the part that does that step.