Help with multiple cameras in a 2D environment

I am currently trying to create a game system that runs in a truly 2D environment, plays like a 2.5D game, and contains games-within-games as mini games. The mini games run on these screens like in the video.

As it is now, the mini games are nested inside the screen prefab and it just plays as-is with masks and stuff. If I rotate a screen, it rotates everything in it, but that changes the physics within the mini games and I don’t want that.

What I want to be able to do is build the mini game in a separate prefab, record the mini game in different sections like how the three screens are, and then project that recording onto the actual screen objects, if that makes sense. If I can do this, I’ll be able to rotate screens, or even shuffle them around to create all kinds of puzzle effects and stuff without messing with the actual game itself.

In the video, I’m just experimenting with cameras and then projecting what they record. I’ll include the settings on the camera and screen.

I don’t like that I have to use a 3D object as a screen instead of being able to just use a 2D object because it might be harder to manage sorting it and it might also be the reason it’s affected by lighting and I don’t need that right now and can’t figure out how to turn it off on a 3D object.

Any ideas on how to get this to work? I feel like it should be more straightforward than it is.

Quad object:

Camera:

Current Nested Screen Object:

Just off the top of my head, I would say that you ought to use RenderTextures. A render texture can take input from a separate camera, and store that output as a texture object. That texture can then be used exactly like any standard texture would be, and applied however you see fit. If your mini-game has a separate camera, then there’s no problem. Create a render texture, assign your mini-game’s camera to that render texture, and then apply that render texture to a 2D sprite object, or a 3D quad object, and do whatever you want with them.

If you don’t want any lighting on your “screen” object, it’s as simple as creating a new material, selecting the “Unlit” shader option, and selecting your render texture as the texture for the Unlit material. A few more tweaks to the material’s settings will insure that it ignores lighting systems and doesn’t cast shadows.

I thought it was a given that I was using a render texture on a quad already. The copy screen in the bottom right of the video is that very quad with the render texture and the camera is positioned on the upper portion of the screen.

I also don’t think I can apply the render texture to a 2D object which is one of the main problems I talked about. If I can, it must be a seriously roundabout way because it wont simply let me drag/drop the render texture onto a sprite in the scene like it will with a quad.

As for the lighting, I think I turned off all of the lighting settings, just like in the screenshot for the quad, but the quad is still darker than the recording. I’m obviously missing something.

Hope somebody who knows about this can help.

There is no essential difference between 2D object and a 3D object in Unity. In fact, for the purposes of rendering, 2D sprites in Unity are often transformed into 3D objects for the actual rendering. Unity Sprites can also be moved and rotated in 3D. But none of that’s actually important.

I noticed that in your screenshot, you are still using the standard shader in the material you have applied to your quad. That is most likely what is causing your problem. Follow the guide I mentioned where you make your own material, and then apply the “Unlit/Texture” shader to it. It is a standard Shader that Unity provides, and it should give you the light-independent functionality you are looking for. With a material using that shader applied, your model will be fully bright, no matter what the lighting is like and no matter what angle it is being viewed from. It is also possible to create a similar 2D material for a Unity Sprite, using the same shader, if you are dead-set on using Sprites.

You were right about setting Unlit/texture which worked for the quad. I could just try to see if I can deal with using the quad, but for the current system I have set up I’d like to try and get a sprite to work with this texture. The reason being that I utilize sorting layers and sorting order a great deal in this project and, if I recall correctly, 3D objects don’t use that, they just use z positioning. Maybe I could switch to a plane instead of a quad… I did and it works, but I’m still going to bet on sprite for now.

Anyway, I made an empty sprite, I made a material with the render texture attached to it, and I assigned it to be the material for the sprite. Sadly, nothing is showing up. I’ve tried messing with the z position, rotation, scale, which worked for making the plane visible, but it’s not affecting the sprite in any way. I’ve also tried using a sprite with an image and all that did was show the sprite.

Is there something wrong with the material, maybe?

Not that important, but I read the manual AFTER the fact and realized that the quad was the better thing to use instead of the plane. Again, not important at all for this problem, though.