3

I'm fairly new to Unity and I'm trying to embed a 3d view inside a 2d one.

I'm working on an emulation app that has a 2d UI for controls and a preview of the result in a 3d box that should be embedded in the 2d one, sort of as a player.

What's the right approach to doing that in Unity? Is there a way of "embedding" one scene in another?

Thanks!

2 Answers 2

2

If you want to create 3D effect with UI canvas, you should look to this link.

If you are using 2D project, it is basically 3D scene with camera set to use ortographic projection, not perspective. So you can use 3D models as well.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks Pavel, is there a way of embedding multiple camera views?
@BarakChamo you mean having multiple UI canvases? Well render mode is property of each Canvas, so it is not a problem to have multiple canvases with different rendering style.
That's really cool! I can have a 3d view with a 2d UI layed on top. Perfect.
1

You should look into Render Texture. Those allows to render a camera view onto a texture in a scene. Say you have a part of a scene an dyou want to render onto a TV screen in your game. You would place the TV scene somewhere and place your camera to view it. Then you create a render texture and apply onto the mesh that is making your tv screen.

Now if you wish to make a UI system, like a radar with a top view, you would modify the viewport of your top view camera (0,0,.2,.2 would place it bottom left corner with 20% height and width) and make the depth higher so that it renders on top of the main camera.

2 Comments

That's pretty cool fafase! How would you render a scene or a canvas in that texture?
I guess it depends on how big a scene you're talking. But you would have one scene with two setups, one where the player moves and one that is just there to be rendered. The second one would be set far enough so that it is not seen. Then you have two cameras one for the main view and one that is rendered in the render texture.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.