Skip to content

[BUG] Bounds Control gets active when object manipulator is disabled #1019

@Maesla

Description

@Maesla

Describe the bug

Bounds control gets active in the state "Focus" if the bounds control is visible and object manipulator gets disabled

To reproduce

Steps to reproduce the behavior:

Bounds Control Bug.zip

  1. See the attachment "Bounds Control Bug.zip". Unzip it and add it to the project
  2. Open the scene "Bounds Test.Unity"
  3. Click "Play"
  4. See how the cube gets selected, and, while is selected, the manipulator gets disabled.
  5. See how the cube keeps the "Focus" state of the bounds control
  6. Stop the execution. Go to the GameObject "Debug" and click "Hot fix" in the Bounds Test. Play again
  7. See how now the behavior is correct

Expected behavior

The bounds control disappears when the object manipulator is disabled

Bounds.Control.mp4

Your setup (please complete the following information)

  • Unity Version [e.g. 2021.3.26f1]
  • MRTK Version or Commit. Latest [e.g. v3.0] [e.g. ba32bb2]

Target platform (please complete the following information)

All of them

Additional context

In this line

bool handlesActive = boundsControl != null && boundsControl.HandlesActive;

HandlesActive returns true when object manpulator is disabled. Because HandlesActive is true, targetActiveFocus is 1, so the focus state stays

Why does HandlesActive become true when the object is disabled? I am not sure but this is the callstack. OnHostDeselected inverts the value of HandlesActive , and, because it was false, now it is true

Image

As a workarround, you can do boundsControl.HandlesActive = false; after objectManipulator.enabled = false;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Help WantedExtra attention is needed to resolve the issue.Type: BugA problem with an existing feature that can be fixed with the next patched release.Type: Good First IssueIssue that is good for newcomers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions