Unity multiple canvases buttons not working
Asked Answered
C

10

0

I have 2 canvases, and each one has a button. When I click one button on one canvas It didn’t let me click on the button on another canvas. I used Debug.Log to confirm the onclick event wasn’t fired, and when I move the second canvas into the first canvas, it works. Can someone help? I found another question that said that raycasttarget needed to be enabled, but in my project it is. This is unity 2022.3.1f1 LTS.

Cinema answered 30/6, 2023 at 13:45 Comment(0)
C
0

Weird. Nothings working. Your canvases have the same settings and I can’t figure out what’s wrong. I think its because the two canvases overlap, but I’ll keep trying.

Cinema answered 30/6, 2023 at 17:28 Comment(0)
S
0

why do you need 2 canvases?

Stroll answered 30/6, 2023 at 14:23 Comment(1)

I need to to make some UI elements Don't Destroy on load for a upgrade menu(In a separate scene), and some UI elements to not be, as these elements need to reload and regenerate with different stats(the entire game is made in UI. Summarized, some UI elements need to be Don't Destroy on load, and as UI elements depend on the root canvas, I created 2 canvases, and know things are starting to break.

Cinema
C
0

Can someone please help me.

Cinema answered 30/6, 2023 at 15:22 Comment(0)
S
0

For me using 2 canvases work fine!

Stroll answered 30/6, 2023 at 16:1 Comment(2)

can you send your canvases?

Stroll

I uploaded canvas screenshots.

Cinema
C
0

Cinema answered 30/6, 2023 at 16:17 Comment(0)
C
0

Cinema answered 30/6, 2023 at 16:17 Comment(0)
C
0

Cinema answered 30/6, 2023 at 16:19 Comment(0)
S
0

i mean export scene or canvases and send me it

Stroll answered 30/6, 2023 at 16:32 Comment(2)

I can't do that. Can I see your canvas settings?

Cinema

I'm a new user.

Cinema
S
0

upload to dropbox/google drive and send me link


image
Stroll answered 30/6, 2023 at 16:45 Comment(1)

Can you send your canvases instead?

Cinema
S
0

here:

Stroll answered 30/6, 2023 at 17:18 Comment(0)
C
0

Weird. Nothings working. Your canvases have the same settings and I can’t figure out what’s wrong. I think its because the two canvases overlap, but I’ll keep trying.

Cinema answered 30/6, 2023 at 17:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.