Hi,
I have a 2D game in which moving elements have UI elements following them. In general, this would not be a problem as it is easy to make UI elements follow a game object using the UIFollowTarget script. The problem is that you can zoom and pan the game camera (this is done by changing its orthographic size and its position). Using the UIFollowTarget script, I get very poor rendering : it seemed as if the UI elements have problems perfectly following the movements of the camera and this resulted in them flickering near the end of their movement.
To solve this problem, I tried having my moving UI elements rendered by my main camera. This way, I don't have to use UIFollowTarget anymore. My setup is this :
- My moving UIPanels are outside of my UIRoot, parented to the game objects they need to follow.
- These moving UI elements are all on the "UI" layer, which is set in the culling mask my main camera. My main camera also have a UICamera script with an event mask set to the "UI" layer.
Everything is working fine with the second approach expect one thing : the scale of my UI panel is completly broken (it is wayyy too small). Is there a way to fix either the first or the second approach? Or is there a better solution to achieve what I want?
Thank you in advance!