main menu with a 3d model

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
hrohibil
Posts: 358
Joined: Thu Nov 04, 2021 12:50 pm

main menu with a 3d model

Post by hrohibil »

Hello

Sorry if this is probraly a basic unity question.

I am using the Menu frame work extras and i try to add a 3D model to be part of the menu, but what ever i do it is not visible in the camera / game view?

User avatar
Tony Li
Posts: 21058
Joined: Thu Jul 18, 2013 1:27 pm

Re: main menu with a 3d model

Post by Tony Li »

Hi,

Screen Space - Overlay canvases always draw on top of everything else. Here are 3 different suggestions:

1. Add a second camera that looks only at the 3D model. Configure it to render to a render texture asset. Then add a UI Raw Image to our canvas, and assign the render texture asset.

2. Or use 2 canvases:
  • Use the first canvas for the title menu. Leave it set to Screen Space - Overlay.
  • Move the background image(s) to a new, second canvas. Set it to Screen Space - Camera. Then you can set its Plane Distance, which is the distance from the camera.
  • Add your 3D model at a closer distance to the camera.
3. Or change the entire menu system canvas to Screen Space - Camera. This will require some adjustment to make everything look the way you want.
hrohibil
Posts: 358
Joined: Thu Nov 04, 2021 12:50 pm

Re: main menu with a 3d model

Post by hrohibil »

I want to go with option 1 but it seems i am missing something.

this is my steps:

1: I create a new camera
2:I set culling mask to ONLY my model.
3:I create a Render texture
4: Add the render texture to my new camera
5: Add a Raw Image to the canvas.
6:Add the Render texture to the raw image.

Issue now is that the whole screen fills with this new render texture??

see image
User avatar
Tony Li
Posts: 21058
Joined: Thu Jul 18, 2013 1:27 pm

Re: main menu with a 3d model

Post by Tony Li »

Make sure to set the size of your Raw Image UI element.

You may also want to set the render texture camera's Clear Flags to Depth Only.
hrohibil
Posts: 358
Joined: Thu Nov 04, 2021 12:50 pm

Re: main menu with a 3d model

Post by hrohibil »

Did the depth part.
How do I change the size of raw image? Scale does not work?

No change.
User avatar
Tony Li
Posts: 21058
Joined: Thu Jul 18, 2013 1:27 pm

Re: main menu with a 3d model

Post by Tony Li »

Change its Rect Transform like any other UI element. It works the same as a UI Image except it shows a texture instead of a sprite.
hrohibil
Posts: 358
Joined: Thu Nov 04, 2021 12:50 pm

Re: main menu with a 3d model

Post by hrohibil »

YES YES it worked.

Is the raw image, can it handle 3d movement? Cause when i play my player object has animation, but for every movement he generates large trails?

IS it only meant for static iamge?
User avatar
Tony Li
Posts: 21058
Joined: Thu Jul 18, 2013 1:27 pm

Re: main menu with a 3d model

Post by Tony Li »

Did you set Clear Flags to Depth Only?
hrohibil
Posts: 358
Joined: Thu Nov 04, 2021 12:50 pm

Re: main menu with a 3d model

Post by hrohibil »

Yes i did
User avatar
Tony Li
Posts: 21058
Joined: Thu Jul 18, 2013 1:27 pm

Re: main menu with a 3d model

Post by Tony Li »

Hmm, you may need to put a background behind the character and set the Clear Flags to Solid Color.
Post Reply