[Possible Bug]: Render textures only work in editor / when ran through "Build & Run"

Hello everyone,

I didn’t know whether to file this under a bug or not. For information, this is my project:

  • Universal RP

  • Renders multiple cameras through a script to the same Render Texture (like a CCTV camera split)

  • Render texture created at runtime

So this script would first assign say 4 cameras a render texture that gets created via the same script, and then gives them all differing positions on that texture so it creates a split view of 4 cameras on one image.

This is to mimick a CCTV camera in the game. It works great in the editor! It even works when you use “Build & Run”

But there lies the problem-- when you launch the game regularly, through the .exe file it creates, it will not work. It simply remains an empty image, the image gets rendered on an object in the game world (a plane) which is visible to a 5th camera (the main camera)

I really, truly have never seen this sort of behavior before. I’ve tried messing with the URP settings or assigning the camera’s a temporary render texture in the prefab (one that exists in the Assets folder), but no dice.

I would very much appreciate if someone here could shed some light on this matter!!

Thank you in advance,
-Gie

Ended up finding out that there was a missing .json file that was the problem.

When you use “Build & Run”, the executable is set to run with the working directory of the game project, whereas if you run the exe it won’t. In the latter, it couldn’t find this .json file, and that caused the script execution on that object to stop, and it wouldn’t create the render textures at all as a result.

Heya! I’m running into a similar problem.

There are two RenderTextures in my game. One is a video feed displayed constantly, the other is used for rendering pictures when you take them in-game.

There is no issue on my computer, but when some other people play the game, the textures do not appear.

Your issue sounds similar, but I’m not exactly sure how you fixed the issue? Did you recreate the .json file? What is the file called?

I’d appreciate it a ton if you could help me out.

My Discord handle is: ‘keveatscheese’ if you’d like to contact me there. Thanks