Create a 360 Joystick for mobile?

I want to create mobile games and I figured out how to create a 360 joystick button to move the player around.

However, If I add the Joystick button to the UI layer that’s above the Base Layer, Problems arise. For example, Testing the position and distance of the Foreground Button to the background (Which I then use to move the player at a certain speed and direction) it gives incorrect results. I think this might be due to a offset in the layer cameras.

And if I leave it on the base layer and keep it on screen by making it relative to the camera position or player position, I get a stuttering effect.

Any help or suggestions appreciated. Maybe even examples of working versions or alternatives.

Hi, I have no experience with that but there is a tutorial by wishforge with a link to the project files, maybe this could be helpful?

Hi, thanks for the reply.

This does help, but I still don’t know how to make the joystick stay onscreen when the camera follows the player. Since Whishforge only explained this with a static camera. And if I add it to another layer there’s a offset that I (for the life of me) cannot figure out.