Skip to content

Comments

Fix for issue #30: Canvas interaction without VRCUIShape#46

Merged
calle242 merged 1 commit intoreleases/1.2.2from
ui-interactable-fix
Aug 19, 2022
Merged

Fix for issue #30: Canvas interaction without VRCUIShape#46
calle242 merged 1 commit intoreleases/1.2.2from
ui-interactable-fix

Conversation

@calle242
Copy link
Contributor

Fixes an issue where UI is not interactable when moved into Canvas that has no VRCUIShape script on Start.

In the test package provided here, a Canvas gets childed to another canvas which has no child VRC_UiShape.

Raycasts then fail to work because the new parent has no Event Camera (which VRC_UiShapes add to their parents).
The new child does have a VRC_UiShape but it doesn't add an Event Camera due to already having been initialized.

This fix iterates all scene Canvases in Start, and sets the _playerCamera if their event camera is null, which is a broken state anyway. Question: do we know of any other systems relying on cameras, that this might mess with?

@calle242 calle242 changed the title Fixes for issue #30: Canvas interaction without VRCUIShape Fix for issue #30: Canvas interaction without VRCUIShape Aug 17, 2022
Copy link
Collaborator

@momo-the-monster momo-the-monster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, fixes the issue as far as I can tell, and works fine without any canvases in the scene. My only request is that you point this PR to merge into releases/1.2.2 instead of main. I've already added a changelog there and included a note on this fix.

@calle242 calle242 changed the base branch from main to releases/1.2.2 August 19, 2022 19:18
@calle242 calle242 merged commit a000259 into releases/1.2.2 Aug 19, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Aug 19, 2022
@momo-the-monster momo-the-monster deleted the ui-interactable-fix branch April 14, 2023 19:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants