Skip to content

Fix virtual cursor "jumping" after disabling/reenabling when a canvas scaler is applied by also applying the scaling on enable - #2485

Open
Tak wants to merge 1 commit into
Unity-Technologies:developfrom
Tak:fix/virtual-cursor-position-after-reenable
Open

Tak wants to merge 1 commit into
Unity-Technologies:developfrom
Tak:fix/virtual-cursor-position-after-reenable

Conversation

@Tak

@Tak Tak commented Sep 21, 2026

Copy link
Copy Markdown

Description

Situation: You have a canvas with a canvas scaler and you're using the virtual mouse pointer.
If you disable and reenable the pointer, it will "jump", because, although the screenspace position is scaled correctly* in UpdateMotion(), it is not scaled when setting the anchored position in OnEnable()

Testing status & QA

Steps to reproduce:

  • Set up a canvas with a virtual mouse pointer and a canvas scaler
  • Add a script that disables and reenables the virtual mouse pointer component
  • Expected: When reenabled, the virtual mouse pointer is at the same position it was when disabled
  • Actual (before): The virtual mouse pointer is warped to a different position
  • Actual (after): When reenabled, the virtual mouse pointer is at the same position it was when disabled

Overall Product Risks

  • Complexity: low
  • Halo Effect: low

Comments to reviewers

… scaler is applied by also applying the scaling on enable
@cla-assistant-unity

cla-assistant-unity Bot commented Sep 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant