Skip to main content
A
19d ago

Unity - Rive not working on Camera without tag "MainCamera"

Hi, When using a rive file on Unity, if my camera in the scene is tagged with "MainCamera", it"s working fine.
But if I remove this tag, it is not working anymore. I can see my Rive UI on the editor and in the game view, as long as I'm not "playing". But if I press play, in both the editor, or the game itself, the rive UI is gone.

I really need to find a solution because in my project, I can't put "MainCamera" as a tag on my camera, I need to have another tag...

It seems that Rive is doing something "with" the mainCamera on initialization.

Is there a way to force the reference of my camera ?

5 replies
A
(edited) 18d ago

You're using Built-in RP, right? This is coming as a feature in the next Unity update soon. Right now, we try to get the main camera in the scene, but if there isn't one, the new version of the package will get any camera in the scene.

For now, as a workaround, you should also be able to fetch the BuiltInRenderPipelineHandler in the scene and then set the RenderCamera property to the camera that you want to use.

A
18d ago

Hello, Yes Indeed. So I added the script BuiltInRenderPipelineHandler in my scene, and set the Render Camera with the camera from my scene. (so with no MainCamera tag). And it still doesn't render my Rive UI.

My Canvas is like so :

A
18d ago

I also have this error when using this script :

I'm using Unity 2022.3.48f1 on Android platform with OpenGLES3 as Graphics API

17d ago

Hi, instead of adding a new BuiltInRenderPipelineHandler component. Could you try getting the existing one in the scene in a script e.g. with FindObjectOfType<BuiltInRenderPipelineHandler>() , and then set the RenderCamera property to the Camera reference.

A
17d ago

It works ! Thank you. Looking forward to the new updates coming along for Unity and Unreal usage :D