Rotate object according to camera direction

Hello, I am doing a kind of 2d navigation, I would like the object (arrow) to move in the direction in which the person is looking (camera), how could I achieve it? I leave an image so that you understand what I am talking about…

Thanks!

PS: It is not noticeable, but the blue circle has an arrow in the center, so that it is understood.

Arrow.transform.forward = camera.transform.forward should work

1 Like

thanks very much!

Edit:
I just tried it on my cell phone and it doesn’t work, although in the emulator it moves when I move to the camera that I assign to it (the main one) but on my cell phone, when I rotate it doesn’t do anything… any idea of something I’m missing?

Are you sure you properly updated the app?

Yes, I am also a beginner in c# and in unity, maybe I am doing something wrong, I have a main camera and then I have an object, where inside that I have the arrow/indicator and I have a camera (to see the map on the screen) , then, I put the script in the first GameObject that contains the other two and in its script I have two public variables to bring the indicated camera and the arrow… am I doing something wrong? I leave some images to better illustrate:

Thanks!

Edit:
I thought that the camera itself was oriented according to where I was looking in real life, but no, it was silly to think that. I should implement a compass but I have no idea how to do it.