- Home /
Making a world-space UI look at all split-screen cameras? (split screen health bars)
I am working on a split-screen multiplayer game that relies heavily on 2D sprites and world space canvases that face the player camera. Think DOOM or any other game that uses 2D sprites in a 3D world.
When the game was single-player only (one camera), I accomplished this task very simply with the transform.lookat() function. However, when I introduced a second player camera I ran into the issue that sprites would only face one of the active cameras, and ignore the other. I fixed this by using the new RenderPipelineManager event "RenderPipelineManager_beginCameraRendering" to rotate the sprite mid-render, on a camera-to-camera basis. This works great!
My problem now is that I can't get the world space canvases (the health bars) to do the same. The frame debugger has revealed to me that the world space canvas is rendered in the Canvas.RenderSubBath, which leads me to believe that there must be some sort of canvas event I can use to rotate the canvas mid-render on a camera-to-camera basis.
I'm stuck! Does anyone here have any experience with split-screen and world space canvases? What has worked for you?
Thank you!
Your answer
Follow this Question
Related Questions
Convert UI element to world position 1 Answer
Strange UI Button hover offset when using Worldspace Canvas in VR 4 Answers
World Canvas and Locked Cursor 0 Answers
translating world position to (scaled) world-space canvas 0 Answers
World Space Canvas not rendering in front of Overlay Canvas 0 Answers