BarakChamo
BarakChamo

Reputation: 3575

Unity3D - Embedding a 3d scene in a 2d scene

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!

Upvotes: 3

Views: 738

Answers (2)

Everts
Everts

Reputation: 10701

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.

Upvotes: 1

Pavel Pája Halbich
Pavel Pája Halbich

Reputation: 1583

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.

Upvotes: 2

Related Questions